# To show that $\mathbb R$ is the only non-empty clopen set in $\mathbb R$ [duplicate]

Without using any notion of connected sets how can we show that $\mathbb R$ is the only non-empty clopen set in $\mathbb R$ ? ( actually I am proving that if $f: \mathbb R \to \mathbb R$ is a continuous function satisfying $|x-y| \le M |f(x)-f(y)| , \forall x,y \in \mathbb R$ , for some $M\in \mathbb R$ then $f$ is surjective by showing $f(\mathbb R)$ is clopen )

## marked as duplicate by BCLC, Michael Greinecker♦Sep 15 '18 at 8:31

• Let $\varnothing \neq U \neq \mathbb{R}$ be open. Show that $U$ is not closed. Consider $x\in U,\, y \in \mathbb{R}\setminus U$ and either $\sup \{ u\in U : u < y\}$ or $\inf \{ u\in U : u > y\}$. – Daniel Fischer Jun 25 '14 at 14:19
• Why avoid connectedness? You're basically going to walk through a proof of connectedness without using the word "connected." – Neal Jun 25 '14 at 14:22
• @Neal: It's perfectly ok if I have to walk through a proof of connectedness without using the word "connected". Actually I want a basic proof from definitions – Souvik Dey Jun 25 '14 at 14:24
• @DanielFischer: Could you please elaborate ? – Souvik Dey Jun 25 '14 at 14:37

Let $\varnothing \neq U \subsetneqq \mathbb{R}$ open. Pick $x\in U$ and $y\in \mathbb{R}\setminus U$. Suppose first that $x < y$. Let
$$z = \sup \{ u \in U : u < y\}.$$
Show that $z \in \overline{U}\setminus U$. Treat the case $y < x$ symmetrically.
Thus you have shown that any nonempty open set other than $\mathbb{R}$ is not closed.