The initial elastic potential energy stored in the spring is:
[tex]U= \frac{1}{2}k x^2 = \frac{1}{2}(22 N/m)(0.035 m)^2=0.0135 J [/tex]
Then, the spring is released, all this potential energy is converted into kinetic energy of the eraser:
[tex]U= K=0.0135 J [/tex]
Then, the force of friction does a work to stop the eraser in this motion, and this work is equal to
[tex]W=Fd[/tex]
where F is the magnitude of the friction force and d is the distance covered by the eraser.
For energy conservation, the work done by the friction force must be equal to the initial energy of the eraser, so:
[tex]K=W=Fd[/tex]
and so we find d:
[tex]d= \frac{K}{F}= \frac{0.0135 J}{0.042 N}=0.32 m [/tex]