Mazda offered a backup cam that displayed in the rearview mirror as an option.
I installed one of these on my car when it was new. This was a while ago, so the details are a little foggy. The kit came with a harness that runs from the mirror, over to the left a pillar, then behind the dash, then under the kick plates to the rear of the car. I'd check the plugs at the mirror itself and at the camera. The other thing to check is in the footwell - the harness taps into the car's electrical system there, where it picks up power and the reverse signal. As I recall the taps were pretty cheap looking so they may have come loose.