First of all, you cannot purchase Mavericks. Given that you have OS 10.7 already on your iMac, you can upgrade to Mavericks through the App store.
Secondly, how exactly are you getting to Disk Utility? If you are doing it via your "normaL' startup, you will not be able to use Disk Utility from there to have it do repairs. For your situation, there are 2 ways to do that:
1. If you have a Mac OS on a DVD, then you can start up your iMac from your DVD drive. To do that, you would:
- Insert the Mac OS X Install DVD into the DVD drive. ...
- Shut down or restart your Mac. ...
- Press and hold down the C key immediately, and keep it pressed until your Mac either boots from the DVD or doesn't.
It sounds like, though, you dod not have such a DVD (you don't happen to have the original Lion DVD, do you?)
2. Based on that link Cory provided above, you should be able to get to Disk Utility via "recovery Mode", so that it can repair your internal drive. If that is not the case, you can boot directly to that hidden Recovery partition. Here is a link that tells you how, along with describing other software there:
https://support.apple.com/en-us/HT201314
If that still does not work, then unless you have access to another Mac to have it try and fix your drive, you need a more robust disk maintenance/repair program like TechTool Pro or Disk Warrior.