pcf8523 has a dedicated Vbat pin that should be connected to a coin cell battery.
The chip automatically switches between Vdd and battery.
from the datasheet
The PCF8523 has a backup battery switch-over circuit, which detects power failures and
automatically switches to the battery supply when a power failure occurs.
If it stops running then there is obviously something wrong with your setup.
see adafruit breakout board https://www.adafruit.com/product/3295