Repair the Hard Drive and Permissions - Yosemite, Mavericks, Mountain Lion or Lion
Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears.
Repair
When the recovery menu appears select Disk Utility and press the Continue button. After Disk Utility loads select the indented Macintosh HD entry from the the left side list. Click on the First Aid tab, then click on the Repair Disk button. If Disk Utility reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit Disk Utility and return to the main menu. Select Restart from the Apple menu.
If this does not help, then backup your files and do the following:
Install or Reinstall OS X from Scratch
Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears.
Erase the hard drive:
1. Select Disk Utility from the main menu and click on the Continue button.
2. After DU loads select your startup volume (usually Macintosh HD) from the
left side list. Click on the Erase tab in the DU main window.
3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on
the Security button and set the Zero Data option to one-pass. Click on
the Erase button and wait until the process has completed.
4. Quit DU and return to the main menu.
Reinstall OS X: Select Reinstall OS X and click on the Install button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible
because it is three times faster than wireless.
This should install the version of OS X that you had installed.