The best thing to do for this issue is re-thermalize the CPU. Aka, put new thermal compound between the CPU and the Heat Sink. This requires about an 1-2 hours of work as the motherboard has to come out of the machine, so you can remove the heatsink screws on the underside.
What you’ll need:
• iMac G5 Disassembly.
• From that point you’ll need some thermal paste.