Try a reset again, reset the iPhone by pressing and holding the sleep/wake button and the home button for 10-15 seconds until the Apple logo appears, ignore the red slider. Then turn back on. You won't lose any data doing the reset. If that fails try a restore http://support.apple.com/kb/HT1414.
I bought a new iPhone 4S not more than 30days ago.. my iPhone 4S on iOS 5.1 was, what seemed to be, randomly powering off.. also, at times, I would pick up my iPhone and I can see the white busy circle going and then the phone would restart itself.. I say seems like it powers off because when I would pick up my iPhone, the screen is blank or black and neither the home button or sleep button would function to wake the iPhone.. each time this happened, I would have to do a hard reset to get the iPhone back on (pressing the home+power button together until the Apple logo appears).. this happened about 2-3 times a day, at random, with some days it not happening. I took the step of updating to the latest iOS, 5.1.1, to resolve this issue, but it still remained..
After reading through the Apple communities, I discovered that many other people have or are suffering with this issue, so i believed my iPhone to be defective..
Today I went to the the best Apple store known to me.. even with an appointment, I had to wait 60+minutes.. In the end, it was WELL WORTH the wait.. she took my phone to run a diagnostic test, she returned and happily replaced my phone with another.
If an restore/update doesn't work for you, go into the Apple store and ask them to replace it ;-)