Equivalence of Definitions of Connected Topological Space/No Continuous Surjection to Discrete Two-Point Space implies No Separation

Theorem
Let $T = \left({S, \tau}\right)$ be a topological space.

Let $T$ be such that there exists no continuous surjection from $T$ onto a discrete two-point space.

Then there exist no open sets $A, B \in \tau$ such that $A, B \ne \varnothing$, $A \cup B = S$ and $A \cap B = \varnothing$.

Proof
Let $T = \left({S, \tau}\right)$ be a topological space such that there exists no continuous surjection from $T$ onto a discrete two-point space.

Let $D = \left({\left\{{0, 1}\right\}, \tau}\right)$ be the discrete two-point space on $\left\{{0, 1}\right\}$.

Let $A$ and $B$ be disjoint open sets of $T$ such that $A \cup B = S$.

The aim is to show that one of them is empty.

Let us define the mapping $f: S \to \left\{{0, 1}\right\}$ by:


 * $f \left({x}\right) = \begin{cases}

0 & : x \in A \\ 1 & : x \in B \end{cases}$

There are only four open sets in $\left\{{0, 1}\right\}$, namely:
 * $\varnothing$
 * $\left\{{0}\right\}$
 * $\left\{{1}\right\}$
 * $\left\{{0, 1}\right\}$

We have that:


 * $f^{-1} \left[{\varnothing}\right] = \varnothing$


 * $f^{-1} \left[{\left\{{0}\right\}}\right] = A$


 * $f^{-1} \left[{\left\{{1}\right\}}\right] = B$


 * $f^{-1} \left[{\left\{{0, 1}\right\}}\right] = S$

where $f^{-1} \left[{X}\right]$ denotes the preimage of the set $X$.

But by hypothesis all of $\varnothing, A, B, S$ are open sets of $T$.

So by definition $f$ is continuous.

Also by hypothesis, $f$ cannot be surjective.

It follows that $f$ must be constant.

So either $A$ or $B$ must be empty, and the other one must be $S$.

Hence the result.