I have an iPhone 4S, and I recently encountered a problem where it wouldn't connect to the AT&T 4G network here in Nashville. It worked fine on WiFi, but it wouldn't load any data over the network. When it happened to my wife a week or so later, I realized that I may not be alone with this problem. So I figured I'd post something so that if anyone else has this problem, they'll be able to find an answer on the internet, something I failed to find when I searched for answers.
The Solution? Turn it off and turn it back on again. Works like a dream. Simple as that. In fact, that's a great thing to do for any weird thing your iPhone may be doing. With no real on/off switch on the iPhone, it's probably on for long stretches of time. Turning it off and on every once in a while is a good idea to keep the thing running good.
So I hope you found you're answer to why your iPhone isn't working right.
Have a great day!