Proving that $A$ is closed in $X$ Can I please receive help/feedback on my proof? Thank you for your time and help!
Suppose $X$ is a topological space, $A\subseteq X, f: X\to A$ is continuous and for each $a\in A, f(a) = a.$ Prove that $A$ is closed in $X.$
$\textbf{Solution:}$ Let $(x,y)$ be a Hausdorff space and let $f$ be a continuous mapping of $X$ into itself. Then the set $A= \{x\colon f(x) = x\}$ is closed. We shall show $X\setminus A$ is open. If $X\setminus A = \emptyset$ then it is clearly open. So let $X\setminus A \ne \emptyset$. Let $a$ be an arbitrary point of $X\setminus A$. Then $f(a) \ne a.$ Since $X$ is a Hausdorff space and $f(a), a$ are distinct points of $X$, there exist disjoint open sets $G$ and $H$ such that $f(a) \in G$ and $a\in H$. As $f$ is continuous, $f^{-1}(G)$ is an open set containing $a$. So $f^{-1}(G)\cap H$ is an open set containing $a$. 
We claim $f^{-1}(G) \cap H \subseteq X\setminus A.$ Let $z\in f^{-1}(G) \cap H.$ Then $f(z) \in G, z\in H.$ Since $G\cap H = \emptyset, f(z) \ne z.$ So $z\notin A$, i.e. $z\in X\setminus A.$ Thus for each $a\in X\setminus A,$ there exists an open set $f^{-1}(G)\cap H$ such that $a\in f^{-1}(G)\cap H \subseteq X\setminus A.$ Hence, $X\setminus A$ is in a neighborhood of each of its points and so it is open. 
 A: The proof looks fine. Note that this generally goes under the fact that the retract of a Hausdorff space is closed. For a general topological space this is not true however. Pick for example a space with a point that is not closed and then project onto that point.
A: Another way to see this fact (retracts are closed in Hausdorff spaces), is to use nets: suppose $x \in \overline{A}$, then there is a net $a_d, d \in D$ from $A$ converging to $x$. By continuity of $f$, $\lim_d f(a_d) = f(x)$, but because $f$ is the identity on $A$, we also have $\lim_d f(a_d) = \lim_d a_d = x$ and as limits of nets are unique in Hausdorff spaces, we conclude that $f(x)=x$ and so $x \in A$ in particular, showing $\overline{A} \subseteq A$, or $A$ is closed.
Your proof works too, though. But if nets are a tool you know about, then the above proof feels quite natural (at least to me). In metric spaces we could use sequences and have a rigorous proof this way too. In general spaces we do need nets, but their use is similar to the way we use sequences in analysis, e.g.
