The specific heat capacity for Hg is 0.140 J/g·°C, its heat of fusion is 11.6 J/g, and the melting point is -38.83º C.
Liquid mercury will release some of its internal energy to the surroundings when it cools and then solidifies.
Cooling: Q = mcΔT
Q = (28.9 g)(0.140 J/g·°C)(-38.83° C - 25.00° C) = -258 J
Solidification: Q = mL = (28.9 g)(-11.6 J/g) = -335 J
The total energy released is -258 J - 335 J = -593 J
The negative sign represents energy lost by the system.