# Intervals are connected and the only connected sets in $\mathbb{R}$

As the topic, prove that Intervals are connected and only connected in $\mathbb{R}$. I know what is the definition of connected set. But not sure how to prove that.

-
Maybe some of the discussion here is helpful? Set $A$ interval in $\mathbb{R}\implies$ connected –  yunone Nov 17 '12 at 5:56
In Principles of Mathematical Analysis by Rudin, a proof for the same is given. –  Gautam Shenoy Nov 17 '12 at 5:58

$\newcommand{\cl}{\operatorname{cl}}$HINTS: Suppose that $A\subseteq\Bbb R$ is not an interval; then there are points $a,b\in A$ and $x\in\Bbb R\setminus A$ such that $a<x<b$. Use the sets $A\cap(\leftarrow,x)$ and $A\cap(x,\to)$ to show that $A$ is not connected.
The other direction is a bit harder. Suppose that $A$ is not connected. Then there is an open set $U$ in $\Bbb R$ such that $A\cap U\ne\varnothing\ne A\setminus U$ and $A\cap U= A\cap\cl U$; why? Fix $a\in A\cap U$ and $b\in A\setminus U$ and show that $[a,b]\nsubseteq A$, so that $A$ cannot be an interval.
@Mathematics: $[0,1)$ and $[1,2]$ are disjoint, but their union is $[0,2]$, which is connected. It is important that $A\cap U$ and $A\setminus U$ are both relatively open subsets of $A$. –  Brian M. Scott Nov 17 '12 at 6:23
$A\cup U\ne\emptyset\ne A\setminus U\implies A\cup U \ne A\setminus U$?I am a little bit confused with the notation –  Mathematics Nov 17 '12 at 6:37
@Mathematics: No, it doesn’t. But it’s true that $A\cup U\ne A\setminus U$, simply because $U\ne\varnothing$. I think that you’re making this more complicated than it really is; all I’m saying is that if $A$ is not connected, there must be an open $U$ in $\Bbb R$ such that $A\cap U$ and $A\setminus\cl U$ are non-empty relatively open subsets of $A$ whose union is $A$ $-$ in other words, a disconnection of $A$. –  Brian M. Scott Nov 17 '12 at 6:40