The mirror does not reverse images from left to right, it reverses them from front to back relative to the front of the mirror.
Stand facing a mirror.
Point to one side. You and your mirror image are pointing in the same direction.
Point to the front. Your mirror image is pointing in the opposite direction to you.
Point upwards. You both point in the same direction.
Now stand sideways on to the mirror and repeat. You are now pointing in opposite directions when you point sideways. Place the mirror on the floor and stand on it. This time you point in opposite directions when you point upwards and your upside down image points downwards.
In all cases the direction reverses only when you point towards or away from the mirror.
The answer stems from the fact that a reflection is not the same as a rotation. Our bodies have a strong left-right symmetry, and we try to interpret the reflection as a rotation about a central vertical axis.
We imagine the world in front of the mirror has been rotated through 180 degree about the mirror’s vertical axis, and it has arrived behind the mirror where we see the image.
Such a rotation would put the head and feet where we expect them, but leave the left and right sides of the body on opposite sides to where they appear in the reflection.
But if instead we imagine the world to have been rotated about a horizontal axis running across the mirror, this would leave you standing on your head, but would keep the left and right sides of your body in the expected positions. The image would then appear top/bottom inverted, but not left-right.
So whether you see the image as left-right inverted or top-bottom inverted, or for that matter inverted about any other axis, depends upon which axis you unconsciously (and erroneously) imagine the world has been rotated about.
If you lie on the floor in front of a mirror you can observe both effects at once. The room appears left-right reflected about its vertical axis, while you interpret your body as being left-right reflected about a horizontal axis running from head to foot.
Actually, a mirror does not invert at all. Look at your face in a mirror: the left side appears on the left and the right on the right.
Now look at someone else’s face without a mirror.
It has been inverted because of the rotation necessary to turn and look at you: their right side is on your left. They could equally well turn to look at you by standing on their head, in which case you see their left on your left, but now the top of their head appears at the bottom. We don’t normally do this because it’s not very comfortable.
Try this experiment. Write a word on a piece of paper and hold it up to a mirror. You automatically rotate it about a vertical axis and it appears in the mirror inverted left to right. It is this rotation which inverts the image, not the mirror.
Try the experiment again, and this time when you hold the paper up to the mirror, rotate it about a horizontal axis. The word will be inverted top to bottom.
The problem is caused by the way we visualise the mirror image. We imagine ourselves standing on a carousel, which has done a half turn to put us where we see the image – that is, in the mirror. We see that the top and bottom of our bodies in the mirror image are in the same place, but left and right are reversed.
If instead of a carousel we used a ferris wheel to rotate ourselves, and imagined ourselves strapped upright in the seat we would see a different result. When the wheel does a half turn, the mirror image now has left and right in the correct places, but top and bottom are reversed.
The trouble is that we are incorrectly using rotation for these experiments, when, in reality, the mirror reflects front-to-back. Because this is a difficult thing to do with our body, we mentally substitute rotation, which doesn’t quite fit what we see.
Generally, we prefer to keep top and bottom correct, so we see a left to right reversal in a mirror, although we could see top to bottom reversal if we wished.