Remember it is 11 + years old, I think it is fairly clear the problem is hardware, specifically what we have no way of knowing. If it were mine I'd have it recycled responsibly as:
A) Apple has considered it obsolete for many years now, meaning parts are no longer available.
B) If you could find parts (most likey used) they would cost more than the computer is worth.
C) You would be guessing at what is wrong and likely throwing money away.
You can take it to an Apple Authorized Service Provider to be diagnosed if you want but as a do-it-yourself project, don't spend the time or money on it.
If you want an iMac then please buy one, if you cannot afford a new one then there are options to get used machines that actually work and are covered by warranties. For example....www.macsales.com sells a number Macs and offers warranties on them and they are very reputable. Avoid places like e-bay, Amazon used, Craigs list. Apple themselves sell refurbished iMacs that are identical to new, have the same warranty as new, are eligible for AppleCare and can save hundreds of $.