As a result of this question, I've been thinking about the following condition on a topological space $Y$:
For every topological space $X$, $E\subseteq X$, and continuous maps $f,g\colon X\to Y$, if $E$ is dense in $X$, and $f$ and $g$ agree on $E$ (that is, $f(e)=g(e)$ for all $e\in E$), then $f=g$.
If $Y$ is Hausdorff, then $Y$ satisfies this condition. The question is whether the converse holds: if $Y$ satisfies the above condition, will it necessarily be Hausdorff?
If $Y$ is not at least $T_1$, then $Y$ does not have the property: if $u,v\in Y$ are such that $u\neq v$ and every open neighborhood of $u$ contains $v$, then let $X$ be the Sierpinski space, $X=\{a,b\}$, $a\neq b$, with topology $\tau=\{\emptyset,\{b\},X\}$, $E=\{b\}$, let $f,g\colon X\to Y$ be given by $f(a)=f(b)=v$, and $g(a)=u$, $g(b)=v$. Then both $f$ and $g$ are continuous, agree on the dense subset $E$, but are distinct.
My attempt at a proof of the converse assumes the Axiom of Choice and proceeded as follows: assume $Y$ is $T_1$ but not $T_2$; let $u$ and $v$ be witnesses to the fact that $Y$ is not $T_2$, let $\mathcal{U}\_s$ and $\mathcal{V}\_t$ be the collection of all open nbds of $s$ that do not contain $t$, and all open nbds of $t$ that do not contain $s$, respectively. Construct a net with index set $\mathcal{U}\_s\times\mathcal{V}\_t$ (ordered by $(U,V)\leq (U',V')$ if and only if $U'\subseteq U$ and $V'\subseteq V$) by letting $y_{(U,V)}$ be a point in $U\cap V$ (this is where AC comes in). Let $E=\{y_{(U,V)}\mid (U,V)\in\mathcal{U}\_s\times\mathcal{V}\_t\}$, and let $X=E\cup\{s\}$. Give $X$ the induced topology; let $f\colon X\to Y$ be the inclusion map, and let $g\colon X\to Y$ be the map that maps $E$ to itself identically, but maps $s$ to $t$.
The only problem is I cannot quite prove that $g$ is continuous; the difficulty arises if I take an open set $\mathcal{O}\in \mathcal{V}_t$; the inverse image under $g$ is equal to $((\mathcal{O}\cap X)-\{t\})\cup\{s\}$, and I have not been able to show that this is open in $X$.
So:
Does the condition above characterize Hausdorff spaces?
If not, I would appreciate a counterexample. If it does characterize Hausdorff, then ideally I would like a way to finish off my proof, but if the proof is unsalvageable (or nobody else can figure out how to finish it off either) then any proof will do.
Added: A little digging turned up this question raised in the Problem Section of the American Mathematical Monthly back in 1964 by Alan Weinstein. The solution by Sim Lasher gives a one paragraph proof that does not require one to consider $T_1$ and non-$T_1$ spaces separately.