Do you have a backup of your files?
If it were me, I would first run diagnostics on the machine (hold the 'D' key at startup) - if no problems are found, I would then attempt a fresh install using a bootable USB installer (which is why you need to have your files backed up as everything on the hard drive will be deleted.)
Before doing a fresh install, you could always try the PRAM/SMC reset, booting into safe mode (hold shift at startup), and repairing the disk with Disk Utility (hold 'R' at startup) - however, if this is a brand new installation, if it were me personally I would just rule out hardware failure and then proceed with a fresh installation.
If this is a mid-2012 13-inch Unibody, have you ever had the SATA cable replaced?