Does the identity map on a dense subset of a space extend uniquely? Let $D$ be a dense subset of a (not necessarily Hausdorff) topological space $X$. 
Does the identity map on $D$ necessarily uniquely extend continuously to the identity on $X$? If not, what additional conditions are necessary to make it extend thus?
 A: There's an easy counterexample for general topological spaces $X$. Just take the trivial topology only consisting of the open sets $\emptyset$ and $X$. If $X$ consists of more then two elements you can take every bijection $f$ of $X$ which has a fixed point $x$, i.e. we have $f(x) = x$ (injections should work too). Since singleton sets $\{x\}$ are dense in the trivial topology $f$ and the identity function are both continuous extensions of the identity on $\{x\}$.
A: If the extension is unique for every dense $D$ then $X$ is $T_0.$ For if $x$ and $y$ cannot be separated by an open set then $D=X\setminus\{x\}$ is dense and the identity on $D$ can be continuously extended by mapping $x$ to $y.$
Thus $T_0$ is a necessary and $T_2$ a sufficient condition.
The cofinite topology on an infinite set shows that $T_1$ is not sufficient. All infinite sets are dense in that topology but the identity can be continuously extended on their complement by deviating from the identity on $X$ in a finite number of points.
The point-avoiding topology on a set of at least 3 elements shows that $T_1$ is not necessary. Let $a$ be the point such that a subset of $X$ is open if and only if it does not contain $a.$ Then the only nontrivial dense subset of $X$ is $X\setminus\{a\}.$ An extension of the identity that maps $a$ to some $b\neq a$ cannot be continuous because the inverse image of the open set $\{b\}$ is $\{a,b\}.$
A: Certainly not.  For instance, if the topology on $X$ is indiscrete, every map $X\to X$ is continuous, and every nonempty subset is dense.
As for conditions that make this true, that seems like a difficult question in general.  A sufficient condition is certainly that $X$ is "Hausdorff relative to $X\setminus D$", meaning that for every $x\in X\setminus D$ and every $y\in X$ distinct from $x$, there are disjoint open sets $U,V$ with $x\in U$ and $y\in V$.  But this is far from necessary.
