Charge battery when power up, use battery when power down
Simple diodes should work.  Select diodes with a low forward drop, and ensure that your line power is just a little bit higher than your battery power.  Connect the cathodes together to feed your load, your battery to the anode of one, and the power supply to the anode of the other.

May as well edit to add based on the comment below, No this won't charge the battery in any way, and essentially completely isolates the battery when the line voltage is sufficient.  Only when the line drops, or dips will the battery supply power. 

Charging is another matter.  This is just a small, simple solution for having automatically switched alternate power sources.