Dont bother with looking at doing both Beijing and Shanghai. On my last Round the world trip, I was spending very little time in each country (a week or less in most cases). I spent 7 days in Beijing and didn't run out of things to do. One thing you should definitely do, is get the address of the hotel written in Chinese characters, because if you need to get a taxi well you'll struggle to find one that understands more than a couple of basic words of English and can't read the English characters. I was there hailing down dozens of taxis for about an hour with no one able to understand english or read my hand written address down (in English writing). The only way I eventually got someone to take me, was by getting them to use their mobile and call the hostel on the phone number I had in my address book. Things to do in Beijing, god I could go on forever. One thing you must do when you are there, is on one of your nights take a trip to the Chinese Acrobats. That is such an amazing show and well worth the cost of entrance and transport there. Another thing that is a must do when in Beijing is take a trip to do a day hike from Jinshaling to Simatai parts of the Great Wall of China. Remember to take plenty to drink and eat because it is 18km of the most amazing walk you'll ever do in your life. It is a section of the wall that is falling to pieces and looks really nice. The Forbidden City, Tiananmen Square, Temple of Heaven, Summer Palace, Old Summer Palace, Imperial Palace, Behai Park and Ming Tombs are all tourist attractions that most visit when in Beijing. Ming Tombs were not really that spectacular especially for how far out of town it was, so save yourself the trip there unless you feel like punishing yourself. That day trip took me to many places, but also had me listen to the faster speaking person on earth who had verbal diareah. She was speaking at like 200wpm in Chinese without hardly so much as a deep breath for over an hour. The only word I could understand that she was being said was Beijing and she mentioned it about 50 times over all. The rest of her babble I couldn't understand and it was driving me to pulling my hair out, listening to it. It wouldn't have been as bad had she spoke at a more normal pace and at least gave it a rest for a while. Even if I understood Chinese it would have driven me mad listening to here speak so fast for so long. The tour was preety cheap for how many sites it took in and how far it went, but the sites weren't anywhere near as good as all the attractions I mentioned above.
If you like good photos, a place you should try and visit is the Dongcheng District in Beijing. That is where the hostel I stayed at was, and it was like the 3rd world part of Beijing. The buildings were mostly businesses, and they were nearly all falling to pieces and made out of bricks that looked like the same quality as mud brick. The area made for some very interesting photos especially when you compare the hostel building to what is directly over the road (a building that the roof and walls were caving in and the walls were made out of waste products). Bad to think that people were even living there, let alone also running a small business.
When you are in China, make sure you haggle the price of items you want to buy down a bit. When the see you are a tourist they'll rip you off badly by terms of what they would charge a Chinese person. Outside the tourist attractions they have people seeling postcards, books etc and one time they offered me these postcards for 50RMB, but after I kept telling him no, and walking away, he kept following me bring down the price further and further. Eventually he bought it down to just 5RMB.