i don't know much about anything but here's an account of what worked for me, after being told by apple there was nothing i could do.
my 17" macbook pro (running lion) had this problem; something weird happened in the download of Mavericks (i think; maybe interrupted), told me my hd was damaged and to back up & restart. Had no back up of my files; "repair disk" wasn't working, then later was greyed-out. I thought i was going to have lose all my data and wipe my drive: and while I did end up having to wipe it, I was able to work around and back up all my files first, which applecare told me there was no way to do (take heart!).
I believe this is the same as what Christo G suggested, but after an hour chatting with apple care in which they told me my HD was shot, and that it needed ($) repair, i tried this and it worked:
1) In disk utility, create a new partition on my external HD. Name it something identifiable; not "hd" e.g.
2) Reboot in recovery mode. Select the option to Reinstall Mac OS X. At this point both Macintosh HD and Recovery HD were "locked' (and couldnt be unlocked through disk utility repairs or anything else), so I couldn't reinstall there even if I wanted to. Select the new partition of the external HD as the destination for the install. Install OS X (mountain lion) there.
3) Rebooting & holding down the Option key after the startup noise, select the disk which is the new partition with OS X (mtn lion) on it. Should be able to boot up from here.
4) When it boots up for the first time, it will give you the option to import data (like, from another computer, from an external disk, etc). Here, *even though my (internal) HD was theoretically Damaged, Failing, Locked, Irreperable, Needed to be serviced by apple, Physically Damaged, etc etc etc,* I was able to import all of my user data and applications from my (internal) HD, simply by selecting the option to import from an external disk, then selecting my (internal) HD. should be able to pick and choose what you want to import: which users, what data, etc.
5) Once that data was imported, OS X starts up (from the external HD, still) with all the data that was on my internal HD (so it looks like my computer did before i tried to install mavericks).
6) Now, create a time machine back up. I did this on the old partition of the external HD that, on its new partition, was currently running OS X. when I created that backup in time machine, it asks if you are sure you want to create a time machine back up on the same something (disk? volume? i can't remember) as your current start up disk. Usually probably a bad idea, but, here... it worked fine. So: you back up everything you have as a time machine back up on that other partition. this took about 7 hours.
7) go to sleep, wake up.
8). To sum up: You are now running OS X mtn lion off one partition of your external hd; on the other partition is a time machine back up of your data. your original HD (the one inside your computer) is irrelevant, if you've done everything up to this point; not only did you managed to copy that data to your new install of OS X/ external HD, you now have it backed up as a time machine backup (on the other partition of that external HD).
9). So: when you are absolutely sure you have your time machine backup made on your external HD, use Disk Utility to Erase your INTERNAL, macintosh HD (*not your external HD!*), the one that couldn't be repaired before, where you were trying to install Mavericks. When I first tried, Disk Utility was not able to unmount the disk; when I restarted, it had no problem. Not sure what the deal is there, others might have a different experience, for better or worse. The Erase took up about 5 seconds. I then verified the disk (which had thrown up all kinds of trouble before), it checked up, verified permissions, gave the "repair disk" a good click or two just to make sure, and it was all clean and good.
10). at this point, with the internal hd wiped clean, and a time machine back up on your external HD, reboot in recovery mode and select "Restore from Time Machine Backup". Select the backup from your external drive, and as the destination select the (now-clean) internal backup. had no problems restoring that backup to the internal drive; computer then restarts (mine automatically restarted using the internal HD as the startup disk) and should be running Mtn Lion, with all the files you backed up from that damaged HD, from your internal HD once again. At this point, after trying to feel sure that i was running off the internal hd's os x, i nervously ejected the external HD. no hitches; all my un-backed-up data; my *working* OS x mtn lion; a functional internal hd; and only some 25 abysmal hours poured into an idle attempt to get Mavericks.
good luck. i hope this is more helpful than confusing. i have a feeling it's not the most direct solution by far, and that it's just a more verbose version of what has been suggested, but in my particular situation (no access to other computers to download 3rd party disk utilities, etc) it was the only thing I could figure out that worked.