You may need to reset the system 'power management unit' &/or reset the PRAM.
Resetting the power-management chip in your Mac (various builds/models)
http://www.thexlab.com/faqs/resetpmchip.html
[.. specific SMU 'power management unit' reset for G5 tower PowerMac ..]
• How to reset the SMU on a Power Mac G5 (Late 2004) or Power Mac G5 (Late 2005) - Apple Support
Also there is a fair chance this issue may relate to a 'dead' clock battery that is
no longer powering the settings (PRAM) memory storage as intended. ~ Get
new replacement battery, and then re-set the clock and related system items.
An example of correct clock battery (PRAM battery) in reference as follows:
As part of troubleshooting, you could also start in Safe mode, to see what if any
Console log error files may tell you in their odd cryptic fashion. Just the fact of
going in Safe mode and let the system go through some automatic stuff then let
it restart normally, can help. (Short of using install-restore DVDs to reinstall.)
• Use safe mode to isolate issues with your Mac - Apple Support
{There may be some other issues that could be the cause of symptoms of note.}
However you will have to deal with the probable causes to troubleshoot. There
may also be a possibility as these units age, for hardware failures. And also of
need to de-dust the power supply & other places that can lead to overheating.
Power supply and logic boards may have failing capacitors, so be aware of this
as a source of problematic issue. There are images online of failed G5 capacitors
{but note the G5 iMac also uses these, and so results of search may show them.}
This may require a bit of take-apart to access fan blades themselves to clean
and also re-seat memory cards, and graphic cards, etc carefully. Note the status
of their contacts, and don't touch them directly. A soft pencil eraser may be used
to wipe fingerprints off gold-colored connections, do so carefully. Gently press
the electronic components back to fully re-seat them once they've been removed.
Avoid static shocks to the electronic parts, an anti-static device is recommended.
In any event...
Good luck & happy trails! 🙂