G5 iMacs fail due to a number of possible reasons, the most common of which being PSU issues as well as motherboard capacitor problems.
There are two types of caps on the logic board, bulging and electrolyte leaks are evidence of failure.
I couldn't say with certainty what your problem is, but as a starter it would appear reasonable to change all 25 logic board caps on a 1st gen G5 model, or 29 caps on a 2nd gen model.
NOTE: Don't make the mistake that many do in just changing out the ones that are bulging or leaking.
If you are just 'ok' at soldering I'd say don't attempt this. Even if you are very good, the difficulty is not so much re-soldering new caps onto the board, but removing the old ones.
These boards were assembled using
lead-free solder, and to add insult to injury it's a
multi-layer board which acts like a heatsink. You may get by with a 40 watt iron, but many claim a 60watt is required.
After having ordered a kit of caps I attempted to change them out, but failed miserably at the removal process, trying 3 different irons in the process. I then found a little Asian guy downtown with all the necessary equipment - including pro desoldering tool - who agreed to perform the task. I handed him the motherboard and kit of caps. He performed a great job for the equivalent of $30.
THIS is where I sourced the kit from - who provided first class service. He also sells a set of caps for the PSU, so that may be a follow-up requirement if the mBoard caps don't solve the problem.
I have another G5 for repair and another kit of caps, but unfortunately the little guy I used first time is no longer present. I'm reluctant to try again myself, but may do now that I have a soldering workstation. Just need extra time, as this is not one of my priority Mac refurbishment tasks.
ALSO worth a read.......