(Proof Verification) Prove that $X$ is connected if and only if the only subsets of $X$ that are clopen are $X$ and ∅

connectednessgeneral-topologyproof-verificationreal-analysis

I have proven that if $X$ and $\emptyset$ are the only open and closed sets then $X$ is connected as follows by contradiction:

Let $X$ and $\emptyset$ be the only open and closed sets and let $X$ be disconnected then there $\exists$ A,B $\subset X$ such that $A \cup B = X$ and $A \cap B = \emptyset$. This implies that $A = B^{c}$ and $B = A^{c}$. But since B is open then $A$ is closed, and since A is open then B is closed which is a contradiction.

However the fact that if X is connected then $X$ and $\emptyset$ are the only clopen sets is not as clear to me. I have tried to prove it by contradiction as well: Assuming that $X$ is connected and that
$\exists$ A $\subset X$ such that A is clopen. However I do not know how to continue the proof.

Best Answer

Assume some non-trivial $A$ is clopen in $X$. Then $A$ and $A^c$ are both non-empty open sets in $X$. Therefore, $A\cup A^c=X$ is a non-trivial separation of $X$ into disjoint open sets. Therefore, $X$ is not connected.