when you say it is turning off and on, do you mean that you turn your computer on, it is fine for a bit, then turns itself off?
or do you mean it does that, yet also turns itself on again
If the latter, does it restart, as if you clicked restart from the start menu, or does it simply power down instantly, then start up again instantly?
If it is the first where it simply turns off, download HWmonitor from here:
http://www.cpuid.com/softwares/hwmonitor.html
and check your temperatures