bounded interval is bounded and connected Can you please tell me if my proof is correct?

Definition:
Let $X$ be a subset of $\mathbb R$. We say that $X$ is connected iff the following property is true: whenever $x, y$ are elements in $X$ such that $x < y$, the bounded interval $[x, y]$ is a subset of $X$ (i.e., every number between $x$ and $y$ is also in $X$)
Lemma: Let $X$ be a subset of the real line. Then the following two statements are logically equivalent:
(a) $X$ is bounded and connected
(b) $X$ is a bounded interval 
Proof:
Show (a) implies (b)
Assume $X\neq\emptyset$. Since $X$ is a bounded set then its supremum  and infimum exists.
Let $m:=\sup X$ and $n:=\inf X$, then $\forall x \in X, n\leq x \leq m$
Suppose $\exists x'$ such that $n<x'<m \sim \& \sim x' \notin X $
Let $c<d, \sim\sim c,d\in X \text{ such that } c<x'<d$ then $[c,d]
> \not \subseteq X$ (!!contradiction) Hence, $(n,m)\subseteq X \subseteq
> [n,m]$
$\therefore X \text{ is a bounded interval}$
Next, we show (b) $\implies$ (a)
Let $X:=[e,f]$ be a bounded interval then $X:=\{x\in R : e<x<f\}$
for every $x,y$ that lie in $X$, such that $x<y$, we have $e\leq x< y \leq f$. 
hence, every element between $x,y$ lie in $X$. 
Therefore, $X$ is connected.
Proof (2nd try)
Show (a) implies (b):
Assume $X\neq\emptyset$. Since $X$ is a bounded set then its supremum  and infimum exist and are defined as $m:=\sup X$ and $n:=\inf X$.
By the upper bound property we know that:
  $$\exists ~~ c ~~ \text{ such that  } m-\epsilon\leq c<m$$
  Also,
  $$\exists ~~ d ~~ \text{such that  } n<d\leq n+\epsilon$$
Now we have $d\leq c$ and $c,d \in X$. Since X is connected, then $[d,c]\subset X$. Suppose $\exists x' \text{   such that   } c<x'<m ~~\&~~ x' \notin X$ then $$[c,m-\epsilon/2) \notsubset X$$(!!contradiction)

I dont know how to proceed further. 
 A: Concerning your first try:
You should explain more carefully the existence of $c$ and $d$ when you prove that $(a)$ implies $(b)$. Notice that you never really make use of the way you defined $m$ and $n$ as supremum and infimum.
In the second part you let $X$ be a special bounded interval. Maybe you should say something about the other ones of form $[e,f)$, $(e,f]$ and $(e,f)$, too. I know this works the same way but then (and only then) you have a complete proof.
You should also try to state more explicitly, why every element between $x$ and $y$ lies in $X$. This is clear from the whole context, but your actual chain of argumentation is like "we have $e \leq x < y \leq f$ hence every element between $x$ and $y$ lies in $X$" which obviously does not work. Apart from this (and some minor issues like writing $x$ instead of $x'$ twice), it looks fine to me.
Concerning your second try:
This is better, however, there are some minor misunderstandings I believe regarding the dependence of $c$ and $d$ on $x'$. You have to choose $\varepsilon$ (hence $c$ and $d$) depending on $x'$ but you start talking about $\varepsilon$, $c$ and $d$ even before $x'$ comes into play and in the end you claim $[c, m - \varepsilon/2) \not\subset X$ would lead to a contradiction, but it is not clear how this should follow from the above (You do not even know if $[c,m - \varepsilon/2)$ is nonempty) .
A better order to do things would be the following:


*

*We want to prove $(n,m) \subseteq X$, so suppose there exists $x' \in (n,m)$ which is not in $X$.

*Now we have to argue that there exist $c,d \in X$ such that $n < d < x' < c < m$. To do so we need to use that $m$ is the supremum and $n$ is the infimum of $X$.

*Having done this we get $(d,c) \subseteq X$ which contradicts our assumption $x' \not\in X$.

A: We know that for $X\neq\phi$, $X\subseteq[\inf X, \sup X]$. We claim that $(\inf X,\sup X)\subseteq X$. Suppose this is false, then $\exists \inf X < y < \sup X$ such that $y\notin X$. Since $y > \inf X$ (resp. $ < \sup X$), there exist $x_{1}\in X$ (resp. $x_{2}\in X$) such that $x_{1}< y$ (resp. $y<x_{2}$). Since $X$ is connected $y\in[x_{1}, x_{2}]\subseteq X$, a contradiction. Now we can take various cases depending upon whether $\inf X$ (resp. $\sup X$) lie in $X$ or not. 
