Topological Proof that every Interval $I \subset \mathbb{R}$ is connected First, the definition of a connected set:

Definition: A topological space is connected if, and only if, it cannot be divided in two
  nonempty, open and disjoint subsets, or, similarly, if the empty set and the whole set are the 
  only subsets that are open and closed at the same time.

I don't understand some points in the following proof, that every interval $I \subset \mathbb{R}$ is connected.
Suppose $I = A \cup B$ and $A \cap B = \emptyset$, $A$ and $B$ are both non-empty and open in the subspace-topology of $I \subset \mathbb{R}$. Choose $a\in A$ and $b\in B$ and suppose $a < b$. Let $s := \mathrm{inf}\{ x \in B ~|~ a < x \}$. Then in every neighborhood of $s$ there are points of $B$ (because of the definition of the infimum), but also of $A$, then if not $s = a$, then $a < s$ and the open intervall $(a,s)$ lies entirely in $A$. And so $s$ cannot be an inner point of $A$ nor $B$, but this is a contradiction to the property that both $A$ and $B$ be open and $s \in A \cup B$.
With the bold part, I have a problem, why it follows that $(a,s)$ lies entirely in $A$ and it that case it must be that $A = (a,s)$, or not?
 A: If not $s = a$, then $a<s$ because $s$ is the infimum of a set of elements all larger than $a$.
The entire interval $(a, s)$ must be in $A$ because of how $s$ was chosen. The number $s$ has been chosen so that it is smaller than any element in $B$ greater than $a$, so there can't be any elements of $B$ in the interval $(a, s)$, and since $A$ and $B$ between them contain all of $I$, $(a, s)$ must be completely within $A$.
The crux of the proof is that with this $s$ as chosen (and exisiting, by Archimedes' lemma), it can't be in neither $A$ nor $B$, but at the same time it has to be in one of them, since $A$ and $B$ together cover the whole of $I$. Thus we have a contradiction, and we know that our assumption must be wrong, namely that $I$ can be written as the union of two nonempty, disjoint open sets.
A: The following steps lead to a solution:
Exercise 1: Let us assume that we have proved $I=[0,1]$ is connected. Prove that as a consequence $(a,b),[a,b),(a,b],[a,b]$ are connected for any real numbers $a$ and $b$. (Hint: A homeomorphism preserves connectedness and an arbitrary union of connected subspaces with a point in common is connected.)
We have reduced the problem to proving the connectedness of the interval $I=[0,1]$.
Theorem The interval $I=[0,1]$ is connected.
Proof. Let us assume, for a contradiction, that $I=A\cup B$ where $A$ and $B$ are disjoint non-empty closed subspaces of $I$. The function $f:A\times B\to I$ given by the rule $f(a,b)=\left|a-b\right|$ is continuous as it is the restriction of the metric $d:I\times I\to I$ to the subspace $A\times B$. The product $A\times B$ is compact by the compactness of $I$ and an elementary result in point-set topology. The function $f$ is non-zero because $A\cap B=\emptyset$. In particular, there exist $(a,b)\in A\times B$ such that $f(a,b)$ is a minimum value of $f$. If $a<b$ (as we may assume without loss of generality), then there exists $c\in I$ such that $a<c<b$ by the completeness of $\mathbb{R}$. If $c\in A$, then $f(c,b)<f(a,b)$ and if $c\in B$, then $f(a,c)<f(a,b)$; either case is a contradiction. Therefore, $I=[0,1]$ is connected. Q.E.D.
Of course, the proof above assumes the compactness of $I$. Conversely, the following exercise is relevant in this connection:
Exercise 2: Find a proof of the compactness of $I$ using the connectedness of $I$. (Hint: Choose an open cover of $I$ and let $X=\{x\in I:[0,x]\text{ has a finite subcover}\}$. Prove that $X$ is open and closed in $I$.)
Of course, we cannot use Exercise 2 and the theorem above to answer the question as this would be circular reasoning.
I hope this helps!
A: Suppose $I$ is an interval. Suppose that $I$ is disconnected. Then there exists two disjoint open sets $A$ and $B$ in $I$ such that $I=A \cap B.$ Let $a\in A$ and $b\in B$. Without loss of generality, we assume that $a < b$.
Let $\alpha = sup \{ x | a \le x \text{ and } x \in A \}.$ Let $\beta =inf \{ x| x \le b \text{ and } x \in B \}.$ By least upper and lower bound property, both $\alpha $ and $\beta$ exist. if $ \alpha \ne \beta $, then there exists $x \in I$ such that $\alpha < x < \beta .$  But this would mean that $I$ is not the union of $A$ and $B$.
