# What are subsets of $\mathbb{R}$ with standard topology such that they are both open and closed?

What are subsets of $\mathbb{R}$ with standard topology such that they are both open and closed?

It is known that in our case(standard topology) any open subset is union of disjoint intervals. So complement must be union of disjoint segments (maybe of infinite length or zero length - a point). Any segment that is not $\mathbb{R}$ itself has a boundary point. Since segments do not intersects, a boundary point of any segment will also be boundary point in their union. Since an open set can not have boundary points any complement to desired subset can not have segments other than $\mathbb{R}$ itself. So a subset with desired property must be either empty set or $\mathbb{R}$.

Is this proof correct? Is there are other/better proofs?

• are you familiar with the concept of 'connected' sets? – mm-aops Oct 26 '14 at 15:23
• @mm-aops I've just learned it. So my question can be reformulated - prove $\mathbb{R}$ is connected, so it can not be union of 2 disjoint nonempty open subsets. But this is evident as long as we know what are open subsets in $\mathbb{R}$. As long as we split $\mathbb{R}$ into 2 disjoint nonempty open subsets one of them must contain an interval with non-infinite endpoint and that endpoint will not belong to their union. Is it your idea, is second proof is correct? What about proof in the question? – Hedgehog Oct 26 '14 at 16:21
• you can make it even easier as long as you know what 'connected by arcs' mean and that it implies connectedness – mm-aops Oct 26 '14 at 22:44

Let $X$ be a nonempty subset of $\Bbb R$ which is open and closed. Take any $x\in X$.
We will assume that there exists $y>x$, $y\notin X$ and we will get a contradiction. Indeed, let $Y=\{y>x:y\notin X\}$. Our assumption is equivalent to the fact that $Y$ is not empty. Since $Y$ is lower bounded (by $x$), it has an infimum $y_0$. Since $y_0$ is a lower bound of $Y$, every open neighbourhood of $y_0$ intersects $X$ and $y_0\in\bar X=X$. But since $X$ is open, there exists a neighbourhood $(y_0-\epsilon,y_0+\epsilon)$ contained in $X$, so $y_0+\epsilon/2$ is a lower bound of $Y$ greater than $y_0$, which is a contradiction.
Then, every $y>x$ is in $X$.
It can be shown in a similar way that every $y<x$ is in $X$. That is, $X=\Bbb R$.