The oscillations of an actual spring-block system slowly reduce in amplitude and finally the system comes to a halt. What happens to the energy of the system? Does this not violate the law of conservation of energy?
The energy used producing oscillations is kinetic energy. Total energy of the system is kinetic energy plus potential energy. Potential energy is energy not triggered for any action at any moment. When kinetic energy is summed with potential energy, it will always equal total energy. So, what happens to the (kinetic) energy of the system (energy that you see) is that more and more of it converts to potential energy (energy not triggered or at rest).
According to the Law of coservation of energy, energy is neither created nor destroyed.
Then the question lies as to where does the energy go and the system comes to halt? The answer to this is that some of the energy is used up in overcoming friction or the heat due to friction and hence the system eventually comes to halt.This is also seen in the oscillation of a pendullum.