Rudin Theorem 2.47 - Connected Sets in $\mathbb{R}$ I need help with the proof of the converse, as given by Rudin in Principles of Mathematical Analysis, to the following theorem:

Theorem 2.47: A subset $E$ of the real line $\mathbb{R}^1$ is connected if and only if it has the following property: If $x \in E$, $y \in E$, and $x < z < y$ then $z \in E$.
Proof: To prove the converse suppose that $E$ is not connected. Then there are nonempty separated sets $A \text { and } B$ such that $A \cup B = E$. Pick $x \in A, y \in B$ and assume (without loss of generality) $x < y$. Define
$$z = \sup(A \cap [x,y])$$
By Theorem 2.28, $z \in \overline{A}$; hence $z \not\in B$. In particular, $x \leq z < y.$ If $z \not \in A$, it follows that $x < z < y$, and $z \not\in E$.
If $z \in A$, then $z \not\in \overline{B}$, hence there exists $z_1$ such that $z < z_1 < y \text { and } z_1 \not\in B$. Then $x < z_1 < y$ and $z_1 \not \in E$. $_\Box$

What I need help with:
i) I need help understanding what $z$ is and if there is any relationship to $\sup(A)$. I initially thought they were equal, but I constructed an example where they weren't.
ii) I need help understanding why Theorem 2.28 implies that $z \in \overline{A}$. It is my understanding that Theorem 2.28 implies that $z \in \overline{A \cap [x,y]}$. I initially thought that $\overline{A \cap [x,y]} = \overline{A} \cap \overline{[x,y]}$, but I've come to realize that this isn't generally the case and therefore I'm having troubles seeing the implication.
iii) I suppose that I should be able to understand the rest of the proof if I understand i) and ii), but any further added detail would be greatly appreciated.
Thank-you.

For reference:
Definition: Two subsets $A$ and $B$ of a metric space $X$ are said to be separated if $\overline{A} \cap B = \emptyset = A \cap \overline{B}$.
Definition: A set $E \subset X$ is said to be connected if $E$ is not a union of two nonempty separated sets.
Theorem 2.28: Let $E$ be a nonempty set of real numbers which is bounded above. Let $y = \sup(E)$. Then $y \in \overline{E}$. Hence $y \in E$ if $E$ is closed.
 A: A response to iii) of my question with the help of Alex Becker's answer. I'd appreciate if anyone could check my understanding of the rest of the proof. 

In particular, $x \leq z < y.$ 

We have $z \in \overline{A}, z \in [x,y]$ and $x \in \overline{A}$ so $x \leq z$. As $z \not\in B$ and $z \in [x,y]$ we must have $z < y$. 

If $z \not \in A$, it follows that $x < z < y$, and $z \not\in E$. 

As $z \in [x,y]$ and $z \neq x$ (since $z \not\in A$) we have $x < z < y$ and $z \not\in A \cup B = E$. 

If $z \in A$, then $z \not\in \overline{B}$, hence there exists $z_1$ such that $z < z_1 < y \text { and } z_1 \not\in B$. Then $x < z_1 < y$ and $z_1 \not \in E$. 

Since $z \not\in \overline{B}, z \in [x,y]$ and $y \in \overline{B}$ we have $z < y$. As $z \not\in \overline{B}$, $z$ must be in the complement of $\overline{B}$ which is an open set in $\mathbb{R}$. Therefore, there exists $r > 0$ such that $(z - r, z + r) \subset \mathbb{R} - \overline{B}$. So taking $z_1 \in (z,z + r)$ we have $z < z_1 < y \text{ and } z_1 \not\in \overline{B} \supset B$ and clearly, $z_1 \not\in A$ as it would contradict the definition of $z$. Therefore, $x < z_1 < y$ and $z_1 \not\in A \cup B = E$. 
A: i) $z$ is the supremum of $A$, restricted to the region $[x,y]$. This is necessary because we need $z\in [x,y]$.
ii) $\overline{A\cap [x,y]}\subseteq \overline{A}$, so if $z\in \overline{A\cap [x,y]}$ then...
A: The answer above doesn't actually justify (ii), it just asserts it. Here is a justification:
By 2.27(c) we have that if $X$ is a metric space and $E \subset X$, then
 $\overline{E} \subset F$ for every closed set $F \subset X$ such that $E \subset F$.
Focusing on 2.27(c) in particular, and substituting $A \cap [x,y]$ for $E$ and $\overline{A}$ for $F$, we observe that $E \subset A \subset F$, and $F$ is closed. Hence $\overline{A \cap [x,y]} \subset \overline{A}$ (from which the result follows).
A: Proof: To prove the converse suppose that $E$ is not connected. Then there are nonempty separated sets $A$ and $B$ such that $A \cup B = E$. Pick $x \in A, y \in B$ and assume (without loss of generality) $x < y$. Define
$$z = \sup(A \cap [x,y])$$
By Theorem 2.28, $z \in \overline{A\cap [x,y]}\subset \overline{A}$; hence $z \not\in B$. In particular, $x \leq z < y$.
If $z \not \in A$, with $z \not\in B$, it follows that $x < z < y$, and $z \not\in E$.
If $z \in A$, with $z \not\in B$, then $z \not\in \overline{B}$, hence there exists $z_1$ such that $z < z_1 < y \text { and } z_1 \not\in B$. Then $x < z_1 < y$ and $z_1 \not \in E$. $_\Box$
