Boot up holding command-r keys into your Recovery Volume.
First run Disk Utility > Repair Disk, if you get errors run until no errors reported or reports "the disk cannot be fixed". Then, choose Reinstall OS X. This will be an install "in place" and shouldn't effect any of your own data or settings.
That said you should always have a good backup, anything can happen at any time, not just during installing.
Also, before you re-install have you tried shutting down from your Guest account? It may be a problem in your Home folder in which case re-installing won't help. It also may be some third process.
Thanks for the reply.
I have checked my 3rd party apps seeing which one it could be. However hard to pinpoint. I have tried Console logs but unable to see anything in the log that shows which app it might be.
Tried safe mode but no change when restarting/shutdown. When I do restart the computer it displays what it is doing in verbose mode. It never did that before.
I have a good time capsule backup too. Should I do full restore from an earlier date?
Thanks and I look forward to yur reply.
The only way to properly test would be to do a clean install, which is a PITA.
Have you run AHT (Apple Hardware Test)?
If hardware passes all test (i'd run at lesat 10 loops and you'll want to do that ovenight) you could try a Time Machine full restore from a previous date. Or, a clean install with selective migration from TM.
EDIT: Have you run EtreCheck a simple diagnostic utility that might turn up something?