Let f, g and x be given.
Assume Hfg: f = g.
rewrite the current goal using Hfg (from left to right).
Use reflexivity.