Could you provide a little more information? Do you mean, the phone suddenly switches off while you are using it or does it literally turn on and then off and then on again by itself?
The first thing i could do is get the battery checked out. Sometimes batteries go bad and then typically the phone just switches off.
The second thing you could do is factory reset the device. So it goes back to what it was when you purchased it. That might help things.