Your iMac is nearing 3 years old, come October. PowerPC Macs have been known to have logic board failures, so if that is the case, then you are stuck. A logic board replacement could cost from $500 to well over $1000. For that price, you could get a bigger and better iMac with an Intel CPU.
If the hard drive is acting up, I would suggest wiping/replacing it if possible. My friend has a pre-iSight G5, and he told me that you can easily take the back off and remove any parts you want to. From pictures I've seen, getting in there and swapping the drive isn't too hard. With this in mind, you'd only have to find a compatible hard drive to stick in there. Of course, if the drive is working fine, don't go this route.
You could attempt to upgrade the RAM and clean up your hard drive to improve performance. RAM isn't too hard to get these days. The G5s support up 2.5GB I think, so throwing a 2GB stick in there will help some. If your hard drive is full, removing old, unnecessary files may speed things up a bit. But, if you choose to reinstall the system, you could just save your critical programs and data and drag them back onto the disk later on.
What system are you running on it anyway? If you are using Leopard (OS 10.5), the poor performance isn't surprising, even though G5 Macs are supported. The friend I mentioned installed Leopard on his G5, but has decided that Tiger may be a better choice; he uses it for recording and his recording software and products will not run on it. Performance is sluggish as well, if I remember right. If you are using Tiger (OS 10.4), then maybe the machine is at fault. Tiger should run fine on it. Let us know how you get on.