Strong form of Urysohn Lemma Let $A$ and $B$ are two disjoint closed subsets of a connected normal space $X$. Prove there exists a continuous function $f:X\rightarrow [0,1]$ s.t. $f(A)=\{0\}, \space f(B)=\{1\}.$  Also $\forall r\in \mathbb{Q}\cap[0,1]$ , the interior of $f^{-1}(r)$ is not empty.

This is an exercise in my textbook and it's about the strong form of the Urysohn lemma. The proof for the lemma in the text book uses the dyadic rationals, so I'm trying to apply it to the above case, but have made no progress.
Any help will be appreciated.
 A: This is a very challenging proof. The correct statement of Urysohn's Lemma has $A\subseteq f^{-1}(0)$ and $B\subseteq f^{-1}(1)$. If this is the lemma I'm thinking of then it is formally stated as:

Let $A$,$B$ be disjoint closed sets in a normal space $X$. Then for each diadic rational $r \in [0,1]$ there exists an open set $U_r$ such that $A\subseteq U_0$, $B\subseteq (X\setminus U_1)$ and for $r<s$, $\overline{U_r} \subseteq U_s$.

Since Urysohn's lemma provides an equivalent definition of a normal space, we begin by assuming we have a normal space, $X$ with disjoint, nonempty closed sets $A$ and $B$. Let $D\subset [0,1]$ be the set of all dyadic rationals contained in $[0,1]$. Then by the lemma we gain a collection of open sets $\{U_r\}_{r\in D}$ with all the properties outlined in the lemma. Let $f:X\to [0,1]$ be a function defined by $$f(x) = \Biggl\{\begin{array}\text{inf}\{r \mid x \in U_r\} &  x \in X\setminus B \\ 1 & x \in B \end{array}$$ We know there exists $U_0 \in \{U_r\}_{r\in D}$ such that $A\subseteq U_0$. Then $f(a) = 0$ holds for all $a \in A$, so $$f(A) = 0 \implies A = f^{-1}(0) \implies A\subseteq f^{-1}(0)$$ By definition of $f$ it should also be clear that $$f(B) = 1 \implies B = f^{-1}(1) \implies B \subseteq f^{-1}(1)$$ It remains to be shown that $f$ is continuous and that the interior of $f^{-1}(r)$ is nonempty (I'm assuming this $r$ you mentioned is dyadic?) To prove $f$ is continuous we first need two intermediate results:

$\text{If} \space x \in \overline{U_r}\space \text{then} \space f(x)\leq r \tag 1 $

and 

$\text{If} \space x \notin U_r \space \text{then} \space f(x)\geq  r \tag 2 $ 

Both results can be established in a couple lines. Proof by contradiction gets you there quickly. Once you have these two results, choose any $x \in X$ and let $(a,b) \subseteq [0,1]$ be an interval where $f(x) \in (a,b)$. Use the density of $D$ in $[0,1]$ to claim the existence of dyadic rationals $s,t$ such that $$a<s<f(x)<t<b$$
Next apply result $(2)$ to put $x \in U_t$ and apply $(1)$ to deduce $x \notin \overline{U_s}$. Combine the two observations to see $x \in U_t \setminus \overline{U_s}$. For another point $y \in U_t \setminus \overline{U_s}$ we can again use both of our results to show $f(y) \in [s,t]\subset(a,b)$. It might seem weird to do all this stuff, but once done we can conclude that $U_t\setminus \overline{U_s}$ is an open neighborhood of $x$ such that $f\left( U_t\setminus \overline{U_s} \right) \subset (a,b)$ and $U_t\setminus \overline{U_s} \subseteq f^{-1}\big((a,b)\big)$, demonstrating the continuity of $f$. This should serve as a somewhat detailed sketch to help you on your way to completing the proof, but you still need to verify my claims. 
Can you proceed from here using the lemma and what we know about the continuity of $f$ to show that the interior of $f^{-1}(r)$ is nonempty?
A: It seems the following.
First of all, in current formulation the claim is wrong. Indeed, let  $X=\{0,1\}$ be a two-point discrete space, $A=\{0\}$,  and $B=\{1\}$. Then there exists a unique map $f:X\to [0,1]$  such that $f(A)=\{0\}$ and $f(B)=\{1\}$ and it is clear that $f^{-1}(r)=\varnothing$ for each point $r$ different from $0$ or $1$. So we shall need some kind of connectivity of the space $X$.  The usual connectivity suffices, because a continuous image of a connected space is connected, and a connected subset $C$ of the segment $[0,1]$ such that $0,1\in C$ coincides with the segment $[0,1]$.
Next we remark that the question reduces  to the case $X=[0,1]$, $A=\{0\}$ and $B=\{1\}$. Indeed, since $A$ and $B$ are disjoint closed subsets of a normal space $X$, there exists a continuous function $g:X\rightarrow [0,1]$ such that $g(A)=\{0\}$ and $g(B)=\{1\}.$ Now let $h: [0,1]\to [0,1]$ be a continuous function such that $h(0)=0$, $h(1)=1$, and for each rational point $r\in [0,1]$ , the interior of $h^{-1}(r)$ is not empty. Put $f=h\circ g$. Then $f:X\to [0,1]$ is a continuous function, $f(A)=\{0\}$, $h(B)=\{1\},$ and and for each rational point $r\in [0,1]$ , the interior of $f^{-1}(r)$ is not empty.
There is a well-known example of Cantor staircase function $c:[0,1]\to [0,1]$ which has all the reqired properties instead of that the interior of $c^{-1}(r)$ is not empty only for each dyadic rational point $r\in [0,1]$. 
As my experiense shows, usually for applications  of such construction it suffices to demand that the property holds only for a (dense)  set  of dyadic rational points of the segment $[0,1]$ instead of the set of all its rational points. Moreover, by Sierpiński Theorem, for each countable metric space $A$ without isolated points there is a homeomorphism $t$ from the space $X$ to the space of rationals. Unfortunately, we may not always extend the homeomorhism $t$ to the whole segment $[0,1]\subset A$, for instance, because it may not preserve the linear order from $[0,1]$. Neverteless, by Lavrentiev’s Theorem [Kech 3.9], $t$ can be extended to a homeomorphism between $G_\delta$-sets. 
Update. It is well known that (see, for instance [JW]) that for each countable dense subsets $D$ and $E$ of the space $\Bbb R$ of the reals (endowed with the standard topology) there exists a homeomorphism $H$  of the space $\Bbb R$ such that $H(D)=E$ and this can be proved by standard back and forth argument. Considering the segment $[0,1]$ as a compactification of the space $\Bbb R$ and using the monotonicity of homeomorphisms of $\Bbb R$, we see that there exists a homeomorphism $i$ of $[0,1]$  such that $i(0)=0$, $i(1)=1$, and $i(\Bbb D_1)=\Bbb Q_1$, where ($\Bbb D_1$) $\Bbb Q_1$ is the sets of (dyadic) rationals of the segment $[0,1]$. So we can complete our construction of the map $f$ by putting $f=i\circ c\circ g$.
References
[Kech] A. Kechris. Classical Descriptive Set Theory, – Springer, 1995.
[JW] Just and Weese.  Discovering modern Set Theory.
