I just got the imac g5 20' 2gb system. havent installed any new software other then ilife, iwork, msn and mozilla. System started shutting down without me prompting it to, like the power went out. It stopped for a few hours, but now, at best, it lasts 10 minutes online.
1) Does it shutdown if you leave it on with NO programs running and you don't tough it? Or is it only when you're actually using it?
2) Check System Preferences -> "Energy Saver" and make sure that it's not set to go to sleep after 10 minutes. Also look for the "Schedule" button in there and make sure it's not set to turn itself off at a set time.
I'd take it back. Where's you buy it? If it's so new they may just exchange it for another unit.
It sounds like a hardware issue. Maybe something with the power supply? The first Macbooks had an issue where the heat sensor was tricked into thinking the laptop was overheating and it would shut the computer down. That's not a "known issue" with the iMacs but it could be something similar.
At any rate, I think it's something physical so you should either get it fixed or exchanged. No matter where you bought it they should have some sort of allowance for that.