Suppose $f,g$ are continuous functions from $X$ to $Y$, where $X,Y$ are topologies, and $f=g$ Specifically, $f = g$ on $S$, where $S$ is a dense subset of $X$. Is it true that $f = g$ on all of $X$? I'm quite sure that this holds true in the case where $X = \mathbb{R}$, but I don't think it holds true in general. Is this true? If so, could you provide a counterexample where $f \neq g$ on $X$?
 A: It is not true in general. Let $X=(0,1]$ together with two new points $p$ and $q$. Basic open nbhds of $p$ are sets of the form $\{p\}\cup(0,a)$ for $a\in(0,1]$, and basic open nbhds of $q$ are sets of the form $\{q\}\cup(0,a)$ for $a\in(0,1]$. Consider the functions $f,g:[0,1]\to X$ defined as follows:
$$f(x)=\begin{cases}p,&\text{if }x=0\\x,&\text{if }x\in(0,1]\end{cases}$$
and
$$g(x)=\begin{cases}q,&\text{if }x=0\\x,&\text{if }x\in(0,1]\;;\end{cases}$$
$f$ and $g$ agree on the dense subset $(0,1]$ of $[0,1]$, and it’s not hard to check that both are continuous, but $f(0)=p\ne q=g(0)$.
The problem here is that $X$ is not Hausdorff: the points $p$ and $q$ do not have disjoint open nbhds.

Theorem. Let $D$ be a dense subset of a space $X$, let $Y$ be a Hausdorff space, and let $f,g:X\to Y$ be continuous functions such that $f\upharpoonright D=g\upharpoonright D$; then $f=g$.
Proof. If not, there is a point $x\in X$ such that $f(x)\ne g(x)$. $Y$ is Hausdorff, so there are disjoint open sets $U$ and $V$ such that $f(x)\in U$ and $g(x)\in V$. The functions are continuous, so $f^{-1}[U]\cap g^{-1}[V]$ is an open nbhd of $x$ in $X$; call this nbhd $W$. $D$ is dense in $X$, so there is a point $y\in W\cap D$. Can you finish this by spotting the contradiction?

