Here is a simple mains power failure alarm/detector circuit that produces an alarm whenever the mains supply fails. A lot of such circuits are available, but the peculiarity of this circuit is that it requires no backup power source like a battery to power the alarm when the mains is absent.
When there is mains supply the transistor BC558 will be OFF and the capacitor 4700uF will be charged. When the mains supply fails the transistor BC558 becomes ON and the capacitor 4700uF discharges through the BC558 to drive the buzzer to produce an alarm. The capacitor 47uF is the filter capacitor for the bridge. Diode D prevents the discharge of the 47uF when mains fails. If diode D is not there, the alarms will remain silent for a time capacitor 47uF to fully discharge after the power failure.