Here is the sketched situation: We have a bloc of mass M, and a spring attached to one end of that bloc. The bloc is moving and moves into a wall. The spring is compressed up until a certain maximum point. There is no friction between the bloc and the floor.
I have to justify why mechanical energy is conserved if we consider the system bloc&spring together. Usually, mechanical energy is conserved if there are only conservative forces applied to a system. But the wall's reaction force isn't a conservative force -- yet mechanical energy is clearly conserved, with the kinetic energy of the bloc transferred into potential energy for the spring.
What is the right justification for this?