Does this property characterize a space as Hausdorff?
[This answer moved from this question on Arturo's advice]
I think the following goes a long way towards proving a converse:
Let $(Y, T)$ be any T1 topological space with at least two points and let $a$ and $b$ be distinct points in $Y$.
Let $X = Y\setminus\{b\}$. Let $f: X \to Y$ be the inclusion of $X$ in $Y$. Let $g: X \to Y$ agree with $f$ on $X\setminus\{a\}$ and $g(a) = b$.
Finally, define the topology on $X$ to be the coarsest topology that makes both $f$ and $g$ continuous.
With these assumptions it turns out that $X\setminus\{a\}$ is dense in $X$ if and only if $a$ and $b$ do not have disjoint neighbourhoods in $Y$.
To see that this is true, let us construct a base of the topology on $X$. To make $f$ continuous we only need to take the subspace topology. Since X is open in Y this is $S_1 = \{ G \in T \mid b \notin G \}$. To also make $g$ continuous we need to add the open neighbourhoods of $b$, with $b$ replaced by $a$. This gives $S_2 = \{ (H\setminus\{b\} \cup \{a\} \mid H \in T, b \in H \}$. Now $S_1 \cup S_2$ is a subbase of the topology on $X$. Since $S_1$ and $S_2$ are already closed under finite intersection, and each covers $X$, we can say that $B = \{ G \cap H \mid G \in S_1, H \in S_2 \}$ is a base of the topology.
Then (remembering that finite sets are closed in Y) we find that the following are all equivalent:
- $X\setminus\{a\}$ is not dense in $X$
- $\{a\}$ is open in $X$
- $\{a\} \in B$
- there are $G \in S_1, H \in S_2$ such that $G \cap H = \{a\}$
- there are $G \in S_1, H \in S_2$ such that $a \in G$ and $G \cap (H\setminus\{a\}\cup\{b\}) = \oslash$
- $a$ and $b$ have disjoint neighbourhoods in $(Y, T)$.
This problem has a very straightforward solution when you conceptualize convergence of nets in terms of continuity of maps. Given a directed set $I$, the statement that a net $(y_i)_{i\in I}$ in a space $Y$ converges to a point $y$ can be expressed in terms of continuity of a map. Namely, let $X=I\cup\{\infty\}$, topologized such that a set is open iff either it does not contain $\infty$ or it contains the set $\{j\in I:j\geq i\}$ for some $i\in I$. Then $(y_i)$ converges to $y$ iff the map $i\mapsto y_i$, $\infty\mapsto y$ is a continuous map from $X$ to $Y$.
Now we use the characterization of Hausdorff spaces in terms of nets: a space is Hausdorff iff every net has at most one limit. So if $Y$ is not Hausdorff, there is some net $(y_i)_{i\in I}$ in $Y$ which converges to two distinct points $y$ and $y'$, which means that the map $I\to Y$ sending $i$ to $y_i$ can be extended continuously to $X$ by sending $\infty$ to either $y$ or $y'$. Since $I$ is dense in $X$, this is exactly what we're looking for.
Here's a sketch of my idea for proving that $g$ is continuous:
- Show that $s$ and $t$ are witnesses that $Y$ is not $T_2$ iff any eventually nonconstant net converging to $s$ or $t$ converges to both $s$ and $t$.
- Observe that $g$ is continuous on $E$ (why?).
- Show that $g$ is continuous at $s$ by using the convergent net definition as follows: Let $(x_\alpha)$ be a net that converges to $s$. We split into cases:
- $(x_\alpha)$ is eventually constant. Here we need to use that $Y$ is $T_1$. Because of this, $x_\alpha$ is eventually equal to $s$, so $g(x_\alpha)$ is eventually equal to $t$ and hence $g(x_\alpha) \to t = g(s)$.
- $(x_\alpha)$ is not eventually constant and converges to $s$. By the first subresult, we have $g(x_\alpha) \to t = g(s)$.
(NB! My topology class used Munkres' "Topology" which outside of a few exercises never mentions nets. So it might be wrong and full of holes to fill out)
I spent a lot of time trying to figure out some cleverer $X$ than the one you came up with, but it was really hard. It seems obvious though that it has to be constructed from $Y$ somehow. Some of my ideas involved starting with $2^Y$, i.e. the set of indicator functions on $Y$, giving it the product topology and identifying with $\mathcal{P}(Y)$ and from there you can pass to a topology on $E = \lbrace U \cap V \mid U \in \mathcal{U}_s, V \in \mathcal{V}_t \rbrace$, but that effectively boils down to what you did. It doesn't even avoid choice as you still have to use that to define $f$.
Another idea I tried was to consider only the case where $Y$ is infinite and then constructing something using the cofinite topology, but that too didn't pan out.