Have you gone to the Event Viewer and looked at your logs as to why the system thinks he shut down? It should have what started the shut down

Control Panal --> Adminstrative Tools --> Computer Management --> Expand Event Viewer (+ sign) --> System. That should show you the shutdowns and reboots, looks for Warnings and Errors as the log entry Type. If no warnings or errors then look at the "Information" ones around shutdown and just before, might be a clue there. The Security log should also have Logon/Logoff Event, open some and see if they say there were user initiated. You should go through the other logs listed under the view also and see if any things jumps out.

That aside...

I would first try it somewhere else myself, try it in another setting yourself, your power has to be pretty bad to force a shutdown.

You might try it in another spot in the house, on a different circuit (different circuit breaker) than where it is plugged in now, you might have something really noisy on the same circuit, like a window AC unit, or fridge or some high drain thing that causes a big enough sag (voltage drop) for long enough to trip up your PC and not impact other things. If you are getting major sags, then one of the cheapest ways to see is to plug in about a 60W regular lamp to the same plug, if the sag or power is that bad you should see changes in the light. (use a regular lamp with no dimming feature, and not a CFL bulb. Best to do where that lamp is all that is on other than your computer stuff, and in a darkend room or at night.)

Also on the heat side even with good fans and a clean PC, if it is in a bad spot, like in one of the cubby-hole computer desks, it may not be getting enough air circulation, in the shop that would not be the case.

As for the UPS, a good USP will certainly help if you are getting hard drops for long enough, but still if your power turned out to be that bad I would be going after my utility company big time.

I would not blame your house power until I ruled out pretty much everything else. If you get a UPS, just make sure to get one from an outfit in the power business, like APC, not Monster and not no-name, a lot of the cheap and expensive UPS's I have seen are glorified junk, you will sleep better with a brand from a company in the business of making that kind of stuff, as in my example, they make from consumer level to multi-million dollar commercial systems, in other words, they know what they are doing.

Now if your power supply is heavily taxed or is starting to have issues just a little bad power might be tripping it off and in the shops they likely have very clean power and so it worked. If that is the case then a new power supply is the better spend than a UPS.

There are some free diag tools in downloads, sorry can't suggest one off hand, that can read the CPU temps and other system info if your system has the feature/function to provide the info.