Before we continue with the Pi UPS, I consider what's needed for a PC UPS ...
The 'obvious' approach is to use (1) 12v car batteries, (2) a 12v-240v AC inverter and (3) a 12v car battery charger However there are some problems with this - the first of which is that cheap inverters are not designed to run 'for ever'. An inverter normally only runs until the battery is flat - which at high output might be no more than a few 10's of minutes. Even worse is the fact that cheap battery chargers deliver low power - typically 50w or so (up to 5A at 12v), well short of the 300w or so minimum needed to run a PC - since they can take 8-10 hours to recharge a battery. So manufacturers can 'get away' with claiming high output from their inverters - knowing that this can't be maintained for very long without overheating, whilst high power chargers are hard to find (and cost 'an arm and a leg'). So, if your PC needs, say, 300w, you will likely need to purchase a 500w inverter just to avoid it overheating. The main problem for the battery is the current. Assuming a 100% efficient inverter, a 'small' computer needing 300w from a 12v source will draw 300/12 = 25A !! Whilst this is 'no problem' when running from the battery, this is way beyond the capacity of any cheap battery 'charger' supplying 12v from the mains. Indeed, many modern PC's are fitted with 500W power supplies or even higher (750w is not unusual for a 'gaming' PC !) whilst the CPU chip alone often draws 50-100w ! So a simple 'charger -> battery -> inverter -> PC' approach is likely to cost you more than an 'off the shelf' UPS ! The 'only' solution is to stop trying to supply the PC direct from the battery charger and instead design some sort of 'mains switch over' circuit (which is how most PC UPS systems work). The PC is then driven from the mains until the mains is lost, at which point the inverter takes over and draws power from the batteries. When mains power is restored, the PC is 'switched back' to the mains and the UPS charger starts recharging the battery (but at much lower current and thus at the cost of a longer 'recovery' time). In the above example, after mains is lost, at 300W the PC would draw 25A from the battery for however long it takes to shut down - say 10 minutes. When mains is restored, a cheap 4A charger would then take about 6 times longer (6 x 10 = 60 minutes i.e. 1Hr) to recharge the battery back to it's fully charger stats (this is more or less how a 'real' UPS works)

So building a DIY PC UPS is not a simple task, however building a laptop UPS is another matter

Of course if you use a laptop as your main "PC" it will need a lot less power. Battery chargers are still reasonably cheap up to about 8A, which gives you 8x12 = 96w to play with (and a 100w inverter is also quite cheap). Even better SOME laptops have a 'mains power' DC input of 12v (or 18v), in which case you can just wire your 'UPS battery stack' (1x12v or 3x6=18v) to the laptop power block output (using a 10A diode !) and forget about the inverter. Of course, if you want to recharge the batteries as well as use the laptop after power is restored, you will still need a charger (since you won't be able to use the laptop power block to run the laptop and recharge the batteries at the same time).
NB One note of caution - in the 'good old days' a UPS was essentially a simple 'mains to battery to inverter' box. You could plug in a PC, turn it on and it would run until the battery was exhausted.

Many 'modern' boxes claiming to be a 'UPS' are actually 'Power Conditioning supplies' which are ONLY designed to keep the PC running for a few minutes after the mains power is lost (i.e. for just enough time for the PC to perform an orderly shut down). These devices thus ONLY run for 5 to 10 minutes, irrespective of the battery state, and CAN'T BE RESTARTED until mains power is restored.

This means they CAN NOT BE USED as a 'classic UPS' (i.e. as a stand-alone power supply), since THEY WILL NOT START-UP UNLESS MAINS POWER IS PRESENT. Plus (of course) no matter what the 'capacity' of the battery, you will never get more than a few minutes run-time out of them

The reason, of course, is that this lets manufacturers use dirt cheap batteries (and cheap low power recharging circuits) that will never have to run below about 50% of the battery capacity, rather than the more expensive 'deep cycle' batteries (and expensive charging circuits) needed to cope when a UPS runs down to a totally discharged state.

.. and now back to building a Pi UPS