An inverter is an electronic device that converts DC current into AC current at a given voltage and frequency. This simply means that a DC current source has to be available for an inverter to work and this primarily obtained from batteries.
Batteries
The DC current that is needed for conversion to AC current is produced by batteries. The number, capacity and type of batteries that are connected to the inverter determine the amount of backup time that will be provided by the inverter. To ensure that AC power is produced, the batteries have to be charged. Batteries can be charged via solar panels or by an inverter if it has a provision of charging batteries.
Summary
If you are looking to have a backup power system that is powered by an inverter, you will have to purchase the inverter and the batteries too.