Let (x,y) be a point in the closure of , and let be a sequence of points in with limit point (x,y). Then and . But f is continuous, and therefore . Therefore y=f(x) and hence . Thus every limit point of is in , and so is closed.
(If the space is "too big" for closures to be detected by sequences then you will have to replace "sequence" by "directed net" in that proof.)