The rock's density is equivalent to 2667 kg/m3.
mass of rock = F / g (gravitational constant)
= 20/ 9.8
= 2.039 kg
While submerged in water, the rock has displaced (20.0 N - 12.5 N =) 7.5 N worth of water, This convert to the mass: 0.7645 kg.
The density of water is 1000 kg/m3, so the volume of water displaced is (0.7645 kg) / (1000 kg/m3) = 7.645 x 10^-4 m3.
density of rock = mass / volume
= 0.7645 kg/7.645 x 10^-4 m3.
= 2667 kg/m3.