The correct equation that shows the conservation of mechanical energy for the system of a marble attached to a compressed spring is:
\[ \frac{1}{2}mv^2 = \frac{1}{2}kx^2 \]
This equation states that the kinetic energy (\(\frac{1}{2}mv^2\)) of the marble when it is released is equal to the potential energy stored in the compressed spring (\(\frac{1}{2}kx^2\)) at the point of maximum compression.