TITLE: If a nonempty set of real numbers is open and closed, is it $\mathbb{R}$? Why/Why not?
QUESTION [26 upvotes]: In other words, are $\emptyset$ and $\mathbb{R}$ the only open and closed sets in $\mathbb{R}$? Why/Why not?
I tried by assuming a set is equal to its interior points and contains its limit points.
A bounded set will not do since stuff like $[1,4]$ and $\{5\}$ will not work, though that is not really proof. Help please?
Anyway, it must then be unbounded.
If $a$ is a real number then $(a,\infty)$, $(-\infty,a)$, $[a,\infty)$ and $(-\infty,a]$ don't seem to cut it so it must be $\mathbb{R}$.

REPLY [3 votes]: I think I have a simpler proof using the border of $A$:
Let $A \subseteq R$ nonempty, open and closed, and assume $A \neq \mathbb{R}$.
Then $\partial A = \overline A \cap \overline{(\mathbb{R} \setminus A)} = $ ($A=\overline A$ since $A$ closed, same for $\overline{\mathbb{R} \setminus A}$) $ = A \cap (\mathbb{R} \setminus A) = \emptyset$ (the border is empty)
However $x = \sup A(=\overline A) \in \partial A$, a contradiction. $(\forall r>0) \langle x-r, x+r \rangle$ contains points both in $A$ and in $A \setminus \mathbb{R}$.