If your iPhone3GS has been mysteriously restarting itself since you upgraded to iOS5, then the following steps should help you get out of trouble with the phone. It’s worked for me twice:
1- Remove the SIM card from your mobile
2- Enable the (3G & cellular Data)
3- Add the SIM card again.
4- Now .. it will working fine.
Also you can Disable the (3G & cellular Data)
See the full thread at : https://discussions.apple.com/thread/3525102?start=0&tstart=0