Go into Settings/general/about, scroll right to the bottom, touch diagnostic & usage, then diagnostic & usage data.
If there are any entries in there that are called PANIC.PLIST, then your iPhone has a hardware issue and may need to be replaced.
Also, when you are getting the random reboots, take note of the time and date of the reboots and when you look in the diagnostic logs, see if there are any entries in there that correspond with these dates and times.
I had a 4s that would randomly reboot and the PANIC.PLIST was the cause. I went to the Apple Store and it needed to be replaced. I was told that PANIC.PLIST are an indication of a hardware issue.