Please can you check my proof of only clopen sets in $\mathbb R$ is $\mathbb R$ and $\varnothing$ I tried prove the following:
In $\mathbb R$ the only clopen sets are $\mathbb R$ and $\varnothing$.
please can you check my proof? 
Let $S$ be non-empty and proper subset of $\mathbb R$ such that $S$ is both open and closed. Let $x \in S$ and $y \in S^c$. Without loss of generality assume $x < y$. Then $[x,y]$ is closed and non-empty. Also, $S$ is closed hence $S \cap [x,y]$ is closed. By definition of closure, $\sup A \in \overline{A}$ for all sets $A$ and since for closed sets $S$ the closure $\overline{S} = S$ it follows that $s = \sup (S \cap [x,y]) \in (S \cap [x,y])$. 
Similarly, $i = \inf (S^c \cap [x,y]) \in (S^c \cap [x,y])$. 
Then, $i \le s$ because if $i > s$ then there is $s < x < i$ such that $x \notin S \cup S^c$ which is a contradiction. If $i < s$ then there is $i < x < s$ such that $x \notin S \cup S^c$ which would also be a contradiction. Therefore $i = s$. But then $i \in S \cap S^c$ which would again be a contradiction hence $S$ must be either empty or all of $\mathbb R$. 
 A: Your basic idea is correct, completeness is important here.
However, you seem to prove the stronger statement that there is no $S\subset\mathbb [x,y]$ such that $x\in S$, $y\notin S$, $\sup S\in S$ and $\inf ([x,y]\setminus S)\in ([x,y]\setminus S)$. That statement is wrong.
For an example consider $[x,y]=[0,4]$, $S=[0,1)\cup[2,3]$. What happens in your proof if you follow it using this example?
A: Suppose $A\subset\boldsymbol{R}$, $A\notin\{\boldsymbol{R},\emptyset\}$, is closed and open.  Then $A$ and $\boldsymbol{R}\setminus A$ are both non-empty and open, hence $\boldsymbol{R}$ would not be connected.
A: Perhaps this way:
So you've got your interval $I_1 = [x,y]$, where $x\in S$ and $y\in S^c$, and, say, $x<y$ (I hope that under $S^c$ you meant $\mathbb{R}\backslash S$...). Take $z = \frac{x+y}{2}$. Then either $z\in S$ or $z\in S^c$. If $z\in S$, then take $I_2 = [x_1,y_1]$, where $x_1 = z, y_1 = y$, if $z\in S^c$, then take $I_2 = [x_1,y_1]$, where $x_1 = x, y_1 = z$. The idea is to obtain intervals $I_n$ with ends in different sets... Each interval is twice shorter than the previous one. So you'll get the family of closed intervals $\{I_n = [x_n,y_n]\}_{n\in\mathbb{N}}$ with $y_n-x_n\to 0$. Hence there is the unique $x\in \cap_{n\in\mathbb{N}} I_n$. Where does it belong? Obviously it can't belong neither to $S$ nor to $S^c$: indeed, consider for example the case of $x\in S$. Then, since $S$ is open, $x$ is contained there with some open interval. But this cannot be the case since such interval would contain all $I_n$ starting from some $n_0$, and hence infinitely many points from $S^c$ (by construction!) - a contradiction. Since $S^c$ is also open by assumption, a contradiction is obtained in case $x\in S^c$ the same way... So, a contradiction!
A: I don't have permission to give a comment so I will have to post it as an answer, please check the following link Showing that $\mathbb{R}$ is connected. The question which you asked was answered here before. It is good to search this forum before writing the question, but you didn't know the notion `connected set' so you couldn't anyway. Good luck. 
