It sounds like there is are hardware and/or software issues with the internal hard drive. What exact iMac model do you have? Also, what exact Mac OS are you using? Do you have access to another Mac? Also, and extremely important, have you been making backups to an external device? And if that is, hopefully, the case, what software have you been using for the backups?