Show that a retract of a Hausdorff space is closed.
The proof shows that the complement of $A$ is open.
Why $r^{-1}(V\cap A)\cap U$ is disjoint from $A$?
$$ \begin{array}{rcl} y\in r^{-1}(V\cap A)\cap U & \Leftrightarrow & y\in\{ z\in X: r(z)\in V\cap A \}\cap U \\ & \Leftrightarrow & y\in\{ z\in U: r(z)\in V\cap A \}. \end{array} $$ So $y\notin A$. If the opposite was true $\;$($y\in A$)$\;$ it should be $y\in U \Rightarrow r(y)\in U$, $\;$but $r(y)\in V\cap A\subset V$ and $U\cap V=\varnothing$.