Why does phone keep switching off?
Hacker solution: Root it and flash a new kernel. 

Mainstream consumer solution: Restore to factory settings and see if that helps, or go to your wireless carrier store and have them flash your phone.