I tried prove the following:
In $\mathbb R$ the only clopen sets are $\mathbb R$ and $\varnothing$.
please can you check my proof?
Let $S$ be non-empty and proper subset of $\mathbb R$ such that $S$ is both open and closed. Let $x \in S$ and $y \in S^c$. Without loss of generality assume $x < y$. Then $[x,y]$ is closed and non-empty. Also, $S$ is closed hence $S \cap [x,y]$ is closed. By definition of closure, $\sup A \in \overline{A}$ for all sets $A$ and since for closed sets $S$ the closure $\overline{S} = S$ it follows that $s = \sup (S \cap [x,y]) \in (S \cap [x,y])$.
Similarly, $i = \inf (S^c \cap [x,y]) \in (S^c \cap [x,y])$.
Then, $i \le s$ because if $i > s$ then there is $s < x < i$ such that $x \notin S \cup S^c$ which is a contradiction. If $i < s$ then there is $i < x < s$ such that $x \notin S \cup S^c$ which would also be a contradiction. Therefore $i = s$. But then $i \in S \cap S^c$ which would again be a contradiction hence $S$ must be either empty or all of $\mathbb R$.