$X$ is a Hausdorff space and $f:X \rightarrow X$ a continuous function. Prove that $\{x \in X \mid f(x)=x\}$ is closed. (Is my proof correct?) Suppose $X$ is a Hausdorff space and $f:X \rightarrow X$ a continuous function. Prove that the set $\{x \in X \mid f(x)=x\}$ is closed in $X$.
I've already proved this proposition:
Let $X,Y$ be topological spaces with $Y$ Hausdorff, and let $f,g:X \rightarrow Y$ be continuous maps. Then the set
$$
\{x \in X \mid f(x)=g(x)\}
$$
is closed in $X$.
My question is whether I can use this proposition to prove the first statement?
I think I can, because if we let $g:X \rightarrow X$ be the identity map, then $g$ is continuous aswell, and the codomain of $f$ and $g$ is obviously Hausdorff, so the conditions in the above proposition seems to be satisfied.

As an alternative proof for the general case (with both $f$ and $g$, and yes, we can of course take $g=\textrm{id}_X$ to derive the first from the second, as identities are always continuous), we can use nets: if $(x_i)_{i \in I}$ is a net in $X$ converging to some $x \in X$ and all $x_i, i \in I$ are in  $C:=\{x\mid f(x)=g(x)\}$ then 
we know that for all $i$, $f(x_i)=g(x_i)$ by definition of $C$ and so, as $f$ and $g$ are continuous:
$$\lim_i f(x_i) = f(\lim_i x_i) = f(x) \text{ and } \lim_i g(x_i)=g(\lim_i x_i)=g(x)$$ and as the nets $(f(x_i))_i$ and $(g(x_i))_i$ in $Y$ are the same by hypothesis and $Y$ is Hausdorff so that limits of nets are unique: $f(x)=g(x)$ and so $x \in C$ as well. 
So nets from $C$ can only converge to members of $C$, which implies $C$ is closed.
