Unable to prove an exercise in Continuous functions in Topology

The proof writes itself if you use a proof from contradiction:

Suppose, for a contradiction, that $f(x) \neq g(x)$ for some (now fixed) $x \in \overline{A}$.

Then as $Y$ is Hausdorff, there are open, disjoint sets $U,V$ in $Y$ such that $f(x) \in U$ and $g(x) \in V$.

As $f$ is continuous at $x$, there is some open neighbourhood $U_x$ of $x$ such that $$f[U_x] \subseteq U\tag{1}$$

As $g$ is continuous at $x$, there is some open neighbourhood $V_x$ of $x$ such that $$g[V_x] \subseteq V\tag{2}$$

Now $U_x \cap V_x$ is an open neighbourhood of $x$ and as $x \in \overline{A}$, there exists some point $a \in (U_x \cap V_x) \cap A$.

$(1)$ implies (as $a \in U_x$) that $f(a) \in U$. Also, $(2)$ implies that $g(a) \in V$. But then $$f(a) = g(a) \in U \cap V$$

contradicts the disjointness of $U$ and $V$. This contradiction shows that or initial assumption was false and so $f(x)=g(x)$ for all $x \in \overline{A}$.


Hint

As you’re dealing with general topological spaces, you can’t use continuity criteria based on sequences.

Use the continuity criteria based on the fact that inverse image of open subsets are open subsets.

Then proceed by contradiction using Hausdorff criteria.