In the proof for Urysohn's lemma, why isn't "$x\in {U_{r}}$, then $f(x)\leq r$, and if $x\notin {U_{r}}$, then $f(x)\geq r$" true? This proof of Urysohn's lemma states that if $x\in \overline{U_{r}}$, then $f(x)\leq r$, and if $x\notin \overline{U_{r}}$, then $f(x)\geq r$. This portion is given on page 4. 
Isn't this also true for open sets $U$? 
Isn't $x\in {U_{r}}$, then $f(x)\leq r$, and if $x\notin {U_{r}}$, then $f(x)\geq r$ also true, where $U$ is an open set that is not clopen?
EDIT: Justification: 


*

*If $x\in U_{r}$, then $f(x)\leq r$ quite clearly. 

*If $x\notin U_{r}$, but $\in$ every open set whose index is higher than $r$, then $f(x)=r$ (as the greatest lower bound of the indices is mapped to). Else, the $f(x)>r$. 


$x,U_{r},\overline{U}$, all belong to normal space $X$. 
EDIT: Why this is relevant in the proof is:
Let $(a,b)$ be an open interval in $\mathbb{R}$. Then, if $f$ is continuous, $f^{-1}(a,b)$ should also be open. $f^{-1}(a,b)$ contains points that are present in open sets $U_{r}\setminus U_{a}$ such that $a<r<b$. $f^{-1}(a,b)$ can't contain points in $\overline{U_{a}}\setminus U_{a}$ as then $\{a\}$ would be included in the mapping. 
If what I'm saying is true- that if $x\notin U_{r}$, but $\in$ every open set whose index is higher than $r$ then $f(x)\geq r$, then also the mapping $f$ will contain $\{a\}$. 
So what exactly is $f^{-1}(a,b)$?? This seems to be a direct contradiction of the fact that $f^{-1}(a,b)$ contains points that are present in open sets $U_{r}\setminus U_{a}$ such that $a<r<b$. 
$f^{-1}(a,b)$ seems to contain points in sets satisfying the following condition: the greatest lower bound of the indices of the sets is not $a$.
Thanks in advance!
 A: It is true that if $x\in U_r$, then $f(x)\le r$, and if $x\notin U_r$, then $f(x)\ge r$; this just isn't very useful for the proof of Uryson's lemma.
Added after OP’s edit of the question: Note that $U_a$ is defined only for $a\in\Bbb Q$, so you want to start with an open interval $(a,b)$ such that $a,b\in\Bbb Q$. Recall that 
$$f:X\to\Bbb R:x\mapsto\inf\{p\in\Bbb Q:x\in U_p\}\;.$$
Suppose that $f(x)\in(a,b)$, so that $a<f(x)<b$. Clearly $a<f(x)$ implies that $x\notin U_a$. However, I claim that we can say more: $$x\notin\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}\;.$$

Suppose, on the contrary, that $$x\in\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}\;.$$ For any rational $p>a$ there is a rational $q\in(a,p)$, so $x\in\operatorname{cl}U_q\subseteq U_p$. Thus, $$\{p\in\Bbb Q:x\in U_p\}\supseteq\Bbb Q\cap(a,\to)\;.$$ On the other hand, $x\notin U_a$, and for each rational $p\le a$ we have $U_p\subseteq U_a$ and hence $x\notin U_p$, so in fact 
  $$\{p\in\Bbb Q:x\in U_p\}=\Bbb Q\cap(a,\to)\;,$$ and $f(x)=\inf\{p\in\Bbb Q:x\in U_p\}=\inf\big(\Bbb Q\cap(a,\to)\big)=a\notin(a,b)$. This is impossible, so $x$ cannot belong to $\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}$.

Since $b>\inf\{p\in\Bbb Q:x\in U_p\}$, there is a $p\in\Bbb Q$ such that $p<b$ and $x\in U_p$; thus, $$x\in\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}\;.$$
Putting the pieces together, we see that 
$$x\in\left(\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}\right)\setminus\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}\;.$$
Conversely, suppose that
$$x\in\left(\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}\right)\setminus\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}\;.$$
Since $x\in\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}$, there is a rational $p<b$ such that $x\in U_p$, and it follows at once that $f(x)\le p<b$. Since $x\notin\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}$, there is a rational $p>a$ such that $x\notin\operatorname{cl}U_p$ and hence $x\notin U_p$, and it follows that $f(x)\ge p>a$. Thus, $f(x)\in(a,b)$, and we’ve shown that
$$f^{-1}\big[(a,b)\big]=\left(\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}\right)\setminus\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}\;.$$
$\bigcup\{U_p:p\in\Bbb Q\text{ and }p<b\}$ is open, and $\bigcap\{\operatorname{cl}U_p:p\in\Bbb Q\text{ and }p>a\}$ is closed, so their difference, $f^{-1}\big[(a,b)\big]$, is open, just as it should be. Since this is the case for all open intervals $(a,b)$ with rational endpoints, and these form a base for the topology of $\Bbb R$, it follows that $f$ is continuous.
A: It is not relevant to the proof as it is given. The author claims 



*
$x \in \overline{U_r}$ implies $f(x) \le r$. 

* $x \notin U_r$ implies $f(x) \ge r$. 


He then proceeds to show that $O = f^{-1}[(a,b)]$ is open, not by showing it is directly equal to some $U_r$ or difference thereof, but by showing that for every $x$ in $O$, there are rationals $p < q$ (with $a < p < f(x) < q < b$) such that $U_q \setminus \overline{U_p}$ (which is open) is a neighbourhood of $x$ and that it is contained in $O$ (i.e. its image under $f$ is inside $(a,b)$). So this shows that each $x$ in $O$ is an interior point of $O$, ergo $O$ is open. 
Analyzing the proof we can see that 
$$f^{-1}[(a,b)] = \cup \left\{U_q \setminus \overline{U_{p}}\,: a < p < q < b, p,q \in \mathbb{Q}\right\} $$
which is a (countable) union of open sets. 
The fact that $f[  U_q \setminus \overline{U_{p}} ] \subset [p,q]$ is a direct consequence of the 2 claims above, the first applied to $U_q$, showing $f(x) \le q$ (for some $x$ in the set $U_q \setminus \overline{U_{p}}$), because $x \in U_q \subset \overline{U_q}$; on the other hand $x \notin \overline{U_p}$ implies $x \notin U_p$, and then the second claim applies to show $f(x) \ge p$, so $f(x) \in [p,q] \subset (a,b)$  
