Your eyes do exactly the same with all images you see (how could they do otherwise, in fact?). Light enters the eye from a 'virtual image' as if it had come from a real image in the location that you see it. Your eye can only judge what it sees on the basis of the rays entering it. You 'see' an image of yourself in a mirror and that's all your brain can interpret it as. It cannot possibly know about the path the light took, from your face, via the mirror.The question is , there are real objects around.Our eyes have a convex lens.So it forms a real inverted image on retina and our brain interprets by changing it to erect image.But when there is a real image around our brain interprets it as inverted but not erect,why that is so?Why the brain is doing opposite?Also there are cases of virtual object and virtual image in front of our eyes.How that you can explain?
As for the inverted image on the retina thing. We are born (and evolved) with the lenses in our eyes producing inverted images. That's what the brain is working with when it constructs the world in our brains that we are 'seeing'. I believe some experiments were done in which people were given inverting glasses to wear for days on end. After a very short time, they learned to 'see' things the right way up. There is a lot more to vision than a 'camera-like' image on a retina; that's only the start of the vision process.