No non-trivial clopen sets in $\mathbb{R}$? How to give a direct proof? [duplicate]

Solution 1:

Assume for a contradiction that $A$ is a clopen subset of $\mathbb R,\ $ $\emptyset\ne A\ne\mathbb R.$ Choose $a\in A$ and $b\in\mathbb R\setminus A.$ Without loss of generality, we may assume that $a\lt b.$

Let $c=\sup(A\cap[a,b]).$ Since $A$ is closed we have $c\in A,$ and so $a\le c\lt b.$ Now $c\in A$ and $(c,b]\subseteq\mathbb R\setminus A,$ contradicting the assumption that $A$ is open.

Solution 2:

We assume by contraddiction that $A$ is a non trivial clopen set. Let $u \in A$ and consider the family \begin{equation} \mathcal{F} = \{ \ I \ : \ u \in I \ \text{ and } I \subset A \text{ is an open interval }\}. \end{equation}

The union $J = \bigcup\mathcal{F}$ is still an open interval contained in $A$. So $J = (a, b)$ for some $a < u < b$, and $a$ or $b$ must be a real number (not plus or minus infinity). Now assume w.l.o.g. $b \in \mathbb{R}$. Then $b \in \mathbb{R} \setminus A$. Since $\mathbb{R} \setminus A$ is open, there must be an open interval $B$ contained in $\mathbb{R} \setminus A$ containing $b$. But then $B \cap A \ne \emptyset$. And this is a contraddiction.