On step-4 of Munkres' proof of the Urysohn lemma In this question my reference is the book Topology by Munkres. The proof of Urysohn's lemma can be found in section 33. In the last step of the proof, the author says:

Now we prove continuity of $f$. Given a point $x_{0}$ of $X$ and an open interval $(c, d)$ in $\mathbb{R}$ containing the point $f\left(x_{0}\right)$, we wish to find a neighborhood $U$ of $x_{0}$ such that $f(U) \subset(c, d)$. Choose rational numbers $p$ and $q$ such that
$$
c<p<f\left(x_{0}\right)<q<d .
$$
We assert that the open set $U=U_{q}-\bar{U}_{p}$ is the desired neighborhood of $x_{0}$.

My question is: what if $\bar U_p=U_q$ and thus $U=\varnothing$? The book's inductive construction of the sets $\left\{U_p:p\in[0,1]\cap\mathbb Q\right\}$ doesn't seem to exclude this possibility:

Let $P$ be the set of all rational numbers in $[0,1]$. Since $P$ is countable, we may list numbers in $P$ as an infinite sequence, and for convenience we may assume that the first two numbers are $1$ and $0$. First we shall define $U_1=X-B$. Now, $A$ is a closed set contained in the open set $U_1$, so by normality of $X$ we may choose an open set $U_0$ such that $A\subset U_0$ and $\bar U_0\subset U_1$.
In general, let $P_n$ be the first $n$ rational numbers in the infinite sequence, and assume that $U_p$ has been defined for all $p\in P_n$, satisfying the condition that
$$
p<q\quad\Rightarrow\quad \bar U_p\subset U_q.
$$
Let $r$ be the next rational number following $P_n$, and we want to define $U_r$. Since $P_n$ is finite and $r$ is neither $0$ nor $1$, $r$ must have an immediate predecessor $p$ and successor $q$ in $P_n$. Since $\bar U_p$ is a closed set contained in the open set $U_q$, we may find by normality of $X$ an open set, defined to be $U_r$, such that $\bar U_p\subset U_r$ and $\bar U_r\subset U_q$. We assert that the above relation now holds for every pair of elements of $P_{n+1}$. If both elements lie in $P_{n}$, then the condition holds by the induction hypothesis. If one of them is $r$ and the other is a point $s$ of $P_{n}$, then either $s \leq p$ or $s \geq q$, so
$$
\bar{U}_{s} \subset \bar{U}_{p} \subset U_{r}~~~(s\le p),\qquad \bar{U}_{r} \subset U_{q} \subset U_{s}~~~(s\ge q)
$$
In both cases the condition is satisfied, so $U_p$ has been defined for all $p\in P_{n+1}$. By induction it has been defined for all $p\in P$.

Connectedness of the space $X$ seems irrelevant here. But if $X$ is disconnected, it is possible that $\bar U_p=U_q$. Any insight is appreciated. Thanks in advance.
 A: You are absolutely right, the construction does not prevent $\overline U_p = U_q$ for $p < q$. As an example take any disconnected normal space $X$. Let $X = A \cup B$ with disjoint non-empty closed subsets $A, B$. Then $U_1 = A$ and $U_0 = A$ and Munkres' construction shows that all $U_p = A$.
But, as user85667 comments, the essential point is the construction of $f$ via the sets $U_p$. The definition is
$$f(x) = \inf \{ r \in [0,1] \cap \mathbb Q \mid x \in U_r \} .$$
Thus

*

*$f(x) < q$ implies $x \in U_q$:
There exists $r \in [0,1] \cap \mathbb Q$ such that $r < q$ and $x \in U_r$. But $U_r \subset \overline U_r \subset U_q$, thus $x \in U_q$.


*If $f(x) > p$, then $x \notin \overline U_p$:
Choose $r \in [0,1] \cap \mathbb Q$ such that $f(x) > r > p$. Then $x \notin U_r \supset \overline U_p$, thus $x \notin \overline U_p$.
For $p,q \in [0,1] \cap \mathbb Q $ such that $p < f(x_0) < q$ we therefore get $x_0 \in U_q \setminus \overline U_p$, in particular $\overline U_p \subsetneqq U_q$.
Let us now look at the above example of a disconnected $X$. For $x \in A$ we have $f(x) = 0$ and for $x \in B$ we have $f(x) = 1$. There is no $x$ such that $0 < f(x) < 1$, so we do not have a problem.
