It seems like a software problem, and a critical one at that. Most of these problems can be solved by resetting to factory settings as a new iPhone.
If it is critically failing as you suggest, I would back it up via iTunes, then restore it to factory settings (New iPhone) and then restore the backup on to that.