I have an outlet that is not grounded (my ups says there is a building wiring fault) and another outlet that is 25 feet away that is grounded, (no wiring fault).
Is it safe to plug in my computer with UPS to the ungrounded outlet...
or better to use a 12 guage extension cord to plug my UPS into the grounded outlet...
or plug the UPS into the grounded outlet and use an extension cord to plug my computer into the UPS?
All outlets must be grounded for safety reasons. Turn the circuit breaker for the faulty outlet to OFF. Then remove the faceplate and the actual outlet. Check for obvious loose ground wire. As a precaution, buy a new outlet (15A or 20A as the case may be) and replace the defective outlet. The people at the hardware store are helpful.
Do not plug in any device into a non-grounded outlet. Fire hazard. If you want to take it one step further, replace the defective outlet with a GFI outlet (like the ones in the kitchen and baths).
Safety first! Make sure that the circuit breaker is turned OFF, and check before you touch anything.