There exists a function dense in $\mathbb R$ 
Prove by transfinite induction that there is a function $f:\mathbb R \to\mathbb R$ such that $|f^{-1}(r) \bigcap (a,b)| = 2^{\omega}$ for every $a, b, r \in\mathbb R$ and $a < b$.

I have:
Let $F = \{(a,b) \times \{r\}\, |\, a, b, r \in\mathbb R\text{ and }a < b\}$ and $\{F_\xi\, |\, \xi < 2^{\omega}\}$ be an enumeration of $F$.
Also, I have that $(x_\xi, y_\xi) \in F_\xi \setminus \bigcup_{\zeta < \xi} (\{x_\zeta\} \times\mathbb R)$ where $f(x_\xi) = y_\xi$ for all $\xi < 2^{\omega}$.
I'm not sure where to go from here. 
 A: So this is what I came up with. I know it will need cleaned up a bit, but there aren't any major mistakes.
Proof:
Let $F = ${(a,b) $\times$ {r} | a, b, r $\in$ R and $a < b$} and {$F_\xi$ | $\xi <$ 2$^{w}$} be an enumeration of $F$. (I can do this because |$F$| $\le$ |R$^{3}$| $=$ 2$^{w}$)
Now, let ($x_\xi$, $y_\xi$) $\in$ $F_\xi$ \ $\bigcup_{\zeta < \xi}$($x_\zeta$ x R) where f($x_\xi$) = $y_\xi$ for all $\xi <$ 2$^{w}$.
($x_\xi$, $y_\xi$) exists because |$\bigcup_{\zeta < \xi}$($x_\zeta$ x R)| $\le$ |R$^{2}$| = 2$^{w}$ and |$F_\xi$| = |$F$| = |R| = 2$^{w}$.
Now {($x_\xi$, $y_\xi$) | $\xi <$ 2$^{w}$} is a partial function.
Therefore, let R = {$r_\xi$ | $\xi <$ 2$^{w}$}. Choose $U_\xi$ = {($x_\xi$, $y_\xi$), ($t_\xi$, $z_\xi$)}.
We know ($x_\xi$, $y_\xi$) $\in$ $F_\xi$ \ {($x$, $y$)| $x \in \bigcup_{\zeta < \xi}${$x_\zeta$, $t_\zeta$}}. 
Thus, $r_\xi$ = $\begin{cases} t_\xi & r_\xi \not\in \{(x_\xi, y_\xi) | \xi < 2^{w}\}  \\ arbitrary\>otherwise \end{cases}$
Therefore, there exists a function $F_\xi$ such that |$F_\xi^{-1}$(r) $\bigcap$ (a,b)| = 2$^{w}$ for every a, b, r $\in$ R and a $<$ b.
A: This doesn't directly answer your question, but is too long for a comment. For simplicity, I'll work with $[0, 1)\rightarrow [0, 1)$ instead of $\mathbb{R}\rightarrow\mathbb{R}$, just to get rid of annoying details about "integer parts", but this is easily fixed.
It's worth pointing out that transfinite induction is not necessary here. We can come up with explicit, if somewhat ugly, examples.
Here's one:
Say that "the binary expansion" of a real number is its unique binary expansion not ending in an infinite string of "$1$"s (just to get around the issue of multiple binary expansions).
Given a real $r\in [0, 1)$, say $r$ is good if the string "$11$" appears only finitely many times in the binary expansion of $r$. Note that the good reals are dense - for instance, every dyadic rational is good.
Now, given a good real $r$, let $S(r)$ be the infinite binary sequence starting right after the last occrrence of "$11$" in the binary expansion of $r$, and consisting of every fourth bit, skipping the first. So,for instance, if $$r=0.011{\color{green}\wr}0{\color{red}0}010{\color{red}1}001{\color{red}0}101{\color{red}0}100{\color{red}1}001{\color{red}0}101...$$ where the "${\color{green}\wr}$" marks the last occurrence of "$11$", we would have $$S(r)=010010...$$
Then we can define $f(r)$ as:


*

*$f(r)=0$ if $r$ is not good, and

*$f(r)=0.S(r)$ if $r$ is good. Here "$0.S(r)$" is shorthand for the real whose binary expansion is $S(r)$; note that since we don't allow binary expansions ending in all $1$s, $0.S(r)$ is always in $[0, 1)$.
Then given an interval $(a, b)\subseteq [0, 1)$, pick a dyadic rational $s\in (a, b)$ with (terminating) binary expansion $s=0.a_1a_2...a_n$ and $s+2^{-n}<b$, and consider the real $$s'=0.a_1a_2...a_n0b_10i_10b_20i_20b_30i_3...$$ where $r$ has binary expansion $0.b_1b_2b_3...$ and the $i_k$s are any binary digits at all. It's easy to see that $s'\in [0, 1)$ and $f(s')=r$. But:


*

*$s'\in (a, b)$, since $a<s<s'$ but $s'<s+2^{-n}<b$; and

*there are continuum-many possible choices for the sequence $(i_k)_{k\in\mathbb{N}}$.
So indeed $f^{-1}(r)\cap (a, b)$ has size continuum for any real $r\in [0, 1)$ and nontrivial interval $(a, b)\subseteq [0, 1)$.

Replacing "$[0, 1)$" by "$\mathbb{R}$" makes the construction messier, but no mathematically harder.
