This is a simple equality but you have the equality = 0 when the gold is both melted and solid at the same temperature.
The problem does not admit of a solution if there is no change of temperature in the gold
mass * specific heat * change of temperature = mass * specific heat * temperature
One side of this equality would be zero and that would make the solution negative, which is not possible.