We can use the conservation of energy to solve this problem. Since the block oscillates on the frictionless surface, the sum of its kinetic energy and the potential energy of the spring remains constant:
`E = mv^2/2 + kx^2/2` . Here, v is the speed of the block at the time when the spring is the length x shorter than its equilibrium length.
We are given that the block has speed v = 0.5 m/s when x = 4 cm = 0.04 m. This means the total energy of the block is
`E = 50kg*(0.5 m/s)^2/2 + 80 N/m*(0.04 m)^2/2 = 6.31 J` .
The block has the greatest speed when it passes the equilibrium position, that is, when the spring is not stretched and x = 0. At that point the total energy of the block is its kinetic energy:
`mv_(max)^2/2 = E = 6.31 J` .
From here, solving for the greatest speed of the block results in
`v_(max) = sqrt((2E)/m) = 0.503 m/s`
The greatest speed of the block is 0.503 m/s.