Let $(X,\tau)$ be a topological space, let $(Y,\mathscr U)$ be a housdorff space and let $A$ be a nonempty subset of $X$. if $f,g:X \to Y$ are continuous functions such that $f(a)=g(a)$ for all $a\in A$, then $f(x)=g(x)$ for all $x \in \overline A.$
I know that $\overline A= A \cup A'$, suppose on contrary there exists a $y\in A'$ such that $f(y)\neq g(y)$. Since $(Y,\mathscr U)$ be the Housdorff space, $\exists U,V \in \mathscr U:U\cap V=\phi$ such that $f(y)\in U$ and $g(y) \in V$. Since, $f$ is continuous $\exists U_y \in \tau :f(U_y)\subset U$ and $\exists V_y\in \tau:g(V_y)\subset V.$ Since $y\in A'$, so $U_y \cap A\setminus \{y\}$ nonempty. Let $z\in (U_y \cap V_y) \cap A\setminus \{y\}\implies f(z)\in U.$ $f(z)=g(z)$. so $U \cap V$ is not empty. $(Y.\mathscr)$ is not Housdorff. which is a contradiction. Have I write the proof correctly? If yes,How do I use direct proof method to prove the result?
I guess this is the "standard" proof: Consider $C=\left \{ x\in \overline A:f(x)=g(x) \right \}.$ Then, $A\subseteq C$ because $f$ and $g$ agree on $A$, and therefore
$\tag1 \overline A\subseteq \overline C$
On the other hand, the map $h:x\mapsto (f(x),g(x))$ is continuous and the diagonal $\Delta\subset Y\times Y$ is closed (because $Y$ is Hausdorff), so $C=h^{-1}(\Delta)$ is closed in $X$, and therefore
$\tag2 \overline C=C\subseteq \overline A.$
Now, $1).$ and $2).$ combine to give
$\tag3 \overline A=C$
The result follows.