i believe the iphone will work in china (at my last job i had co-workers on cingular/at&t who frequently traveled to asia and used their cell phones over there). but you will pay some exorbitant roaming charges - you should call at&t to see how much this will be and if there are any plan add-ons you can get to lower the roaming rates.
also, you cannot put another sim card in the iphone since it is locked to at&t. and i have to say that i'm puzzled as to why you didn't already know this since it's one of the most controversial issues about the iphone to begin with and has been discussed ad infinitum here and just about all over the web. do a search...
Your iphone will work in Shanghai, If I recall from my last trip the voice was about $1.00 a minute (not including int'l LD if calling outside of China) and data WILL KILL YOU, fortunately I was on a corp data plan at that time and didn't see the bill.
If you will be making calls from China to the US I would recommend getting a prepaid international phone card (NOT SIM, we all know they won't work) that allows you do dial a local Shanghai number, then dial the US using the phone card.
At least this way you'll only be paying roaming charges/airtime for the local Shanghai call, and the Int'l LD will be on the phone card.
It would seem like the cost of the data fees would be so exorbitant (and not really easily stoppable), that you're probably better off just using the money to buy an unlocked GSM phone into which you can put your AT&T SIM card (and then sell, if you wish, when you return).
Until Apple and AT&T solve the problem of insane international data roaming charges leave your iphone at home. The best thing would be to go to Nanjing Road and buy an inexpensive unlocked GSM phone ($100-$150) and use your AT&T sim card to make voice calls. If you want to save even more buy a local sim card and have America call you. It's much cheaper to receive calls than to make them, and with landline intl rates running at around $0.02 minute you can talk a long time.
Wish I had known this before running up a $2000 data bill in China earlier this month.
Wow...I'll be studying abroad there within the next couple of years. I had no idea about the ridiculous data charges. You guys just saved me a fortune. Anyone know if there'd be any extra charges for texting?