$X$ connected if and only if no continuous onto function exists. Let $Y=\{0,1\}$ and $\mathscr{U}=\mathscr{P}(Y)$ be the discrete topology on $Y$. Prove that $(X,\mathcal{T})$ is connected if and only if there is no continuous surjective function from $X$ to $Y$.
Here is my attempt.
Let $X$ be connected.  This is so if and only if $X$ cannot be expressed by the union of two non-empty sets that are separated in $X$. Let there exist a function $f: X \to  Y$ that is continuous and onto. Then $f^{-1}(Y)=X$ because $f$ is onto.  Well $f^{-1}(Y)=f^{-1}(\{0\}\cup\{1\})=f^{-1}(\{0\})\cup f^{-1}(\{1\})$.  Then we have $f^{-1}(\{0\})$ is open because $\{0\}$ is open in $\mathscr U$ and $f$ is continuous. Mirrored logic proves the same for $f^{-1}(\{1\})$. Also, both are non-empty because $f$ is onto. Thus $X$ is equal to the union of two non-empty open sets.  
I am having trouble proving why they are disjoint. Once I prove this, then by contradiction the hypothesis holds. Correct?
 A: They are disconnected because $\left\{0\right \}\cap \left \{1\right\} = \emptyset$ and so $f^{-1}(\left\{0\right \}) \cap f^{-1}(\left \{1\right\}) = f^{-1}(\left\{0\right \}\cap \left \{1\right\}) = f^{-1}(\emptyset) = \emptyset$.
So your proof is correct.
A: If $X$ is connected and if $f:X\to Y$ is continuous, then $f$ is constant, because the only connected subsets of $Y$ are its singletons. As $|Y|=2, f$ cannot be onto.
On the other hand, if $U$ and $V$ are a separation of $X,\ $ then the function $f:X\to Y$ defined by $f(U)=\left \{ 0 \right \}$ and $f(V)=\left \{ 1 \right \}$ is a continuous surjection. 
A: Yes, they are disjoint since either $x\mapsto 0$ or $x\mapsto 1$.
In fact, since the singletons $\{0\}$ and $\{1\}$ of $Y$ are closed sets, the preimages are both closed and open, and disjoint. Their union is the entire space. To not be able to write $X$ as a union of disjoint clopen sets is another definiton of connectedness!
A: The proof is correct.
The disjointness of $f^{-1}(\{0\})$ and $f^{-1}(\{1\})$ can be seen by supposing $x\in f^{-1}(\{0\}) \cap f^{-1}(\{1\}).$
Since $x\in f^{-1}(\{0\}),$ we have $f(x) =0.$ Similarly $f(x)=1.$ But $0\ne 1.$
A: To prove that $f^{-1}(\{0\})$ and $f^{-1}(\{1\})$ are disjoint, just think about what it means for an element $x\in X$ to be an element of both of them.  If $x\in f^{-1}(\{0\})$ that means $f(x)=0$, and if $x\in f^{-1}(\{1\})$ that means $f(x)=1$.  Since $f(x)$ can't be equal to both $0$ and $1$, $x$ can't be an element of both sets.  So their intersection is empty.
This completes your argument.  However, remember that you are proving an "if and only if" statement, and you have only proven one direction: you have proven that if $f:X\to Y$ is continuous and surjective, then $X$ is not connected.  You need to prove the converse as well.  See if you can reverse your reasoning: if $X$ is not connected, you can write it as a union of two disjoint nonempty open subsets $U$ and $V$.  Reversing your argument, you would want to construct $f:X\to Y$ such that $f^{-1}(\{0\})$ is $U$ and $f^{-1}(\{1\})$ is $V$.  Can you define such a function $f$ and prove it is continuous?
