The first step is finding the coefficient of stiffness for the spring (k), which can be found by dividing the Force (N) over Compression (cm). You are given the compression (5cm), and you are told that a 75g mass is hung ‘vertically’ from a fixed point (think gravity), so the Force would be:

N
Which means the coefficient of stiffness is:

Nm
Then the mass is removed, and some new object of unknown mass is hung from the spring. Part (a) of the question doesn’t require you to know the mass of the object, as the equation for the strain energy stored is:

. You already have the coefficient of stiffness, and you also know that the spring has been compressed by 15cm (45 – 30), so the strain energy stored is:

J
For Part (b), you need to realize that the coefficient of stiffness in this particular case is:
Mass of object * 9.8 / Compression
You know what the coefficient and compression is, so you just sub it in to get:

