Leopard can shut your Mac down if it encounters severe directory corruption during boot, so it doesn't continually try to boot.
If the Mac is shutting OFF while you are using it, that's a different issue.
You should try booting to your hardware test - restart while holding the D key. The diagnostics are built-in to the new Macs hard drive, so you don't need to insert any disks.
If you have erased/restored your software, then you may need to insert your restore DVD, and use that same D while booting to that DVD. Try to run that hardware test, choosing the extended test.
By your description, I would suspect the hard drive is not working properly. Contact Apple for service, or simply take to a local Apple service shop.