I'm reasonably confident that any good Mac shop will be able to repair this (as pigoo indicates, it's probably the hard drive) for you, but actually the iMac G5 was discontinued at the end of 2005, so your machine is at least five years old and that's about the average lifespan of home computers.
This is not to say your Mac won't still be useful (once repaired) for a long while to come, just that on average, most people reach the point where they'd rather invest in a new(er) model than spend money on the old one at about the five-or-six year mark.
So you're about due to be considering your next Mac. But again, if the repair turns out to be a modest expense (ie let's say under $300), I'd invest in that.
But if you're not already doing so, this is a good time to also invest in a good backup solution.