General topology I am interested in a proof of very general theorem, well known:
Given a topological space $X$ and a dense subset $A$ (so it has nonempty intersection with any open subset of $X$), and if we are given two continuous functions $f, g$ which map $X$ to $Y$, where $Y$ is another topological space, Hausdorff, and $f(x) = g(x)$ for all $x$ in $A$, then for all $x$ in $X$ it holds $f(x) = g(x)$.
 A: This is false in general, but true if $Y$ is Hausdorff (one also says "separated"). Suppose $f(x)\not= g(x)$ for some $x\in X$. Pick disjoint open subsets $U$, $V$ of $Y$ containing $f(x), g(x)$ respectively.
Now $x\in f^{-1}(U)\cap g^{-1}(V)=:W$ so $W$ is a non-empty open subset of $X$.
Since $A$ is dense in $X$, we can find $y\in A\cap W$.
Now since $y$ lies in $A$, $f(y) = g(y)$. On the other hand, since $y$ lies in $W$, $f(y)\in U$ and $g(y)\in V$. Yet $U, V$ are disjoint, which gives a contradiction.
Let me give for change a simple counter example if $Y$ is not Hausdorff. Let $Y = \{a, b\}$ with the coarsest topology. Then any function $\mathbf{R} \to Y$ is automatically continuous. In particular, two continuous functions can agree on $\mathbf{R}\backslash \{0\}$ but disagree at $0$.
A: This need not be true for general spaces. Let for example $X=[0,1]$, and $Y$ is the quotient space
$$Y=\frac{\{0,1\}\times[0,1]}{(0,x)\sim(1,x) \forall x<1}$$
If $f,g:X\to Y$ such that $f(x)=g(x)=[(0,x)]$ and $f(1)=(0,1)$ and $g(1)=(1,1)$, then they agree on a dense subspace of $X$.
