It might be happening to you that whenever power fails, your computer either restarts or shutdown completely even though you have connected UPS (uninterruptible power supply) or Power Inverter to it. It is a weird situation that UPS totally fails to perform its duty. The problem can be fixed but it requires technical help from an expert. Here, I have discussed in general why it happens and how to resolve the problem.
The major reason behind this problem is that switch over time of UPS is longer than the threshold of power supply of computer. Mostly, good computer power supplies have threshold of almost 15-20 milliseconds which is generated by capacitors inside them. Any interruption of electricity longer than the specified duration can restart or shutdown the computer.
If you are using a good quality expensive power supply then issue is solely related to the relay of UPS. Relay is a device which is responsible for switching over from external power source to backup battery power. Poor quality mechanical relays have longer switch over time. So, the problems arises.
The cheaper modified (simulated) sine wave power inverters that are designed to run with large or small external batteries often cause this problem. Poor relays in them cause longer switch over time from main power source to batteries backup.
In majority cases, problem is solely related to UPS or Power Inverter. Several UPS manufacturers now use solid state relays instead of mechanical relays to fix this issue. Solid state relays are extremely efficient and offer lowest possible switch over time.
If problem is actually related to the relay of UPS as discussed above, it can be fixed by replacing the relay with a better quality mechanical relay or solid state relay. On the other hand, if the problem is related to the capacitors of PSU, the problem can be resolved by installing larger capacitors. These are the technical works and can only be done by experts.
Since, an ordinary user who has no knowledge of electronic circuits can not fix the problem by himself. The best way to overcome the situation is by buying a new better quality UPS or Power Inverter. Make sure to confirm from seller that it is really designed for computers and will not cause troubles. Obviously, it is an expensive solution but quite hassle free.
The other easy fix is change PSU of computer. But this might not work in all cases. Changing UPS (or Power Inverter) is the only reliable and money saving solution as discussed above.