The multiplicative inverses are to be taken with respect to a modulus (here 7). Since the modulus 7 is prime, every number (modulo 7) has an inverse. In particular, 31_7 = 3_7 (since 31 = 4*7 +3 - sorry if I'm too didactic), and its inverse is 5 because 3 * 5 = 15 = 1_7. So we can write |1/31|_7 = 5.
Now
y_2 = |(3 - 19) |(1/31)|_7 |_7
= | (-16) * 5 |_7
= | 5 * 5 |_7 since -16 = (-3)*7 + 5
= 4