Are the only sets in $\mathbb{R^1}$ which are both open and closed $\mathbb{R^1}$ and $\emptyset$? As the topic, how to prove that the only set in $\mathbb{R^1}$ which are both open and close are the $\mathbb{R^1}$ and $\emptyset$. I tried to prove by contradiction, but i can't really show that the assumption implies the contrary.

Let $S\subset \Bbb R$ non-empty, open and closed. Fix $x_0\in S$. Let $I:=\{r>0:[x_0-r,x_0+r]\subset S\}$. As $S$ is open, $I$ is non-empty. If $I$ is bounded, let $\{r_n\}$ be a sequence which increases to $\sup I$. Then $x_0+r_n\in S$ for each $n$, and as $S$ is closed, $x_0+\sup I\in S$. But $S$ is open, so we can find $\delta>0$ such that $x_0\pm \sup I\pm t \in S$ for $0\leq t\leq \delta$, hence $\sup I+\delta\in I$, a contradiction.
So $S=\Bbb R$.
Note that such an approach works for $\Bbb R^d$ instead of $\Bbb R$. Just replace the interval $[x_0-r,x_0+r]$ by the closed ball $\bar B(x^{(0)},r):=\{x\in\Bbb R^d,\max_{1\leq j\leq d}|x_j-x_j^{(0)}|\leq r\}$.
