In general, the big social networks (Facebook, Twitter, etc) are blocked from within China. This applies to mobile devices too. (I'm not sure about Whatsapp, I didn't try it when I was there last year, and it might have changed since then anyway.) Gmail worked, and most other web-based email provides probably will too.
Most foreigners who spend a lot of time in China set themselves up with a VPN of some kind, which essentially tunnels their web traffic to somewhere outside of China before it hits the Internet. If you Google for "VPN china" you will find a wide variety of choices.
The Chinese government seems to allow these VPN connections (and not try to block them), probably because most Chinese citizens wouldn't have a way to pay for them in any case. The big credit card system in China is "UnionPay" which is accepted almost nowhere outside China. Foreigners would be able to pay for VPN service somehow and the Chinese government isn't terribly interested in blocking foreigners' access to the Internet.
Finally, if you've got an unlocked cell phone then it's pretty easy to get a local SIM card with data service. For example, for 100 RMB (about 12 €), you can get a prepay SIM card and with some amount (maybe 100 MB) of data. Then you can top it up by buying additional credit. The providers have systems that interact in both Mandarin and English. (I think I had a SIM from China Unicom.)