# Is there non-trivial subset in real line that is both open and closed?

Or can we prove if A is both open and closed in the real line then it is empty or the whole line? Assuming the standard topology.

-
You may find en.wikipedia.org/wiki/Connected_space relevant. –  Grumpy Parsnip Mar 10 at 1:25

Let $A\subseteq \mathbb R$ and assume $A$ is neither $\varnothing$ nor $\mathbb R$.

Choose $a\in A$ and $b\in \mathbb R\setminus A$. Without loss of generality let's assume $a<b$ (otherwise just swap all of the inequalities henceforth).

Then $A\cap(-\infty,b]$ is nonempty (it contains $a$) and bounded above. By the supremum property it has a least upper bound $x$.

If $x\in A$, then $x<b$, and $(x,b]$ is disjoint from $A$. But that means that no neighborhood of $x$ is completely in $A$, so $A$ is not open.

On the other hand, if $x\notin A$, then $x$ must be a limit point of $A$ -- otherwise $A\cap(-\infty,b]$ would have an upper bound below $x$ contrary to assumptions. Therefore $A$ is not closed.

In either case $A$ is not both open and closed, Q.E.D.

-

No. You can prove that a topological space is connected iff the only clopen sets (sets that are both open and closed) are the empty set and the full space. The real line is clearly connected (as it is path-connected).

-
Proving that path-connected implies connected basically entails proving that $[0,1]$ is connected, which isn't very different from proving $\mathbb{R}$ is connected. –  Mike F Mar 10 at 1:42
@Mike True. When establishing the basics, the hierarchy of ideas is important. My "proof" that $\mathbb{R}$ is connected was intended as more of an observation/sanity check. –  Joshua Pepper Mar 10 at 1:45