Erasing the hard drive and starting over from scratch is one option, but it's usually the last option you should try, not the first. There are many other troubleshooting techniques to try. See my Mac Performance Guide.
If that doesn't help, and erasing and reinstalling starts to look necessary, that is done with Mountain Lion by holding down command-R at startup. This will boot into "recovery mode," which allows you to erase the hard drive with Disk Utility, reinstall the system, etc. Note that reinstalling will require re-downloading the Mountain Lion installer, so you will need to be on a network connection that is capable of downloading about 4+ GB in a reasonable amount of time.
I have tried your solution however when i tried to earase the hard drive a message appired ''error, unable to earase'' i coulnt re-install the OS Mountain lion ''Hard disk Locked'' The main reason i would like to start fresh, is when i upgraded from snow leopard to lion the performance dropped, i even took my imac back to apple store and they runned some test the they could not see any problems, however it is quite obvious that the performance has dropped. The boot takes very long, iphoto take litterary 5mins to start up etc. Please let me know what im missing. Thank you.
What was the exact error message when you tried to erase the hard drive?
One other option to try would be to re-download the Mountain Lion installer from the App Store and then create a bootable Mountain Lion install disk:
Then you can boot from that (hold down the option key at startup with the disk connected) and try erasing the hard drive (or even repartitioning, if erasing fails).
If all attempts to erase fail, your hard drive may be dying, which can certainly cause performance problems.