Let's name the variables we're given:
o: object distance; o = -17.8 cm
i: image distance; i = 31.5 cm
Object distance is negative in relation to the image distance since the image appears on the opposite side of the mirror.
Given these variables, we can use this formula to find f, the focal length:
1/f = 1/i - 1/o
Now, let's plug in our known variables:
1/f = 1/31.5 + 1/17.8
Solving for f,
f = 11.373 cm