You'll need to be more precise in your need. What kind of power failure?

If you want to monitor the PIC itself, you may look some STATUS register bits.