# Are there any other sets that are both open and closed other than $\emptyset$ and $\Bbb R$? [duplicate]

Is there any set $X \subseteq \Bbb R$ so that X is both open and closed, $X \neq \emptyset$, and $X \neq \Bbb R$?

I know $\emptyset$ and $\Bbb R$ are two sets that are both open and closed, but are there any more sets that fit this category?

## marked as duplicate by S.C.B., Arnaud D., David K, Andrés E. Caicedo, user223391 Oct 5 '17 at 17:46

• No, as $\mathbb{R}$ is connected. – Randall Oct 5 '17 at 16:10
• A topological space X is connected if and only if the only clopen sets are the empty set and X. – Walt van Amstel Oct 5 '17 at 16:13
• Depends on your topology. In the discrete topology all sets are both open and closed. (In the discrete topology R is not connected). – fleablood Oct 5 '17 at 17:15

There is this (very basic) result which states that a (topological) space $X$ is connected if and only if $X$ and $\varnothing$ are the only simultaneously open and closed sets (also called clopen sets).

Since $\Bbb R$ is connected, there are no others. But this characterization enables you to decide this question for a wide variaty of spaces $-$ immediately.

No, because if $A \subset \mathbb{R}$ is both open and closed, then $f \equiv \chi_A$ is continuous, since $f^{-1}(\{1\}) = A$ is closed and $f^{-1}({0}) = A^c$ is closed. Then by the intermediate value theorem, $\chi_A$ has to be either identically $0$ or identically $1$. It is here where we use that $\mathbb{R}$ is connected.

Suppose $U \subseteq \mathbb{R}$ is both closed and open, and let $V = \mathbb{R} \setminus U$. Then $V$ is both closed and open, and moreover $U$ and $V$ are disjoint. Suppose, furthermore, that $U$ and $V$ are both non-empty; we will derive a contradiction.

Fix some $u \in U$ and $v \in V$ be fixed. Without loss of generality, assume $u<v$ (otherwise replace $U$ by $V$ and $V$ by $U$.) Define $$E = \{ \varepsilon > 0 \mid x \in U \text{ for all } u \le x \le u+\varepsilon \}$$ Since $U$ is open, $E$ is nonempty. Moreover, $E$ is bounded above by $v-u$, since $v-u > 0$ and $u+(v-u) = v \not \in U$. By completeness of $\mathbb{R}$, the set $E$ has a supremum $\varepsilon^*$.

Let $u^* = u + \varepsilon^*$. It is easy to see that $u^*$ is a limit point of both $U$ and $V$. Indeed, given $\delta > 0$, we have $\varepsilon^* - \delta < \varepsilon < \varepsilon^*$ for some $\varepsilon \in E$ (since $\varepsilon^* = \sup E$), so that $u^*-\delta < u+\varepsilon < u^*$ and $u + \varepsilon \in U$; and $u+\sigma \not \in U$ for some $\varepsilon^* < \sigma < \varepsilon^*+\delta$, since otherwise we'd have $\varepsilon^*+\frac{\delta}{2} \in E$. Since every open interval around $u^*$ intersects both $U$ and $V$, it follows that $u^*$ is a limit point of both $U$ and $V$.

Since both $U$ and $V$ are closed, it follows that $u^* \in U$ and $u^* \in V$. But this contradicts the fact that $U$ and $V$ are disjoint. So it must be the case that one of $U$ and $V$ is empty (and hence the other is $\mathbb{R}$).

In all normed vector space E, E and $\emptyset$ are the only sets that are both open and closed. A set which is open and closed has an empty border ; you can show that E and $\emptyset$ are the only sets with an empty border (take two points, one in the set, the other outside, then use sequences).