The limit of a function with derivative at least $1_\mathbb{Q}$ Let $f:\mathbb{R}\to \mathbb{R}$ be differentiable, such that $f'(x) \ge 1_{\mathbb{Q}}(x)$. Is it true that $\lim_{x\to\infty}f(x) = \infty$?
 A: The Pompeiu function $g:[0,1]\to \mathbb{R}$ is strictly increasing, everywhere differentiable, with derivative vanishing on a dense $G_\delta$ set.  With minor modifications in the construction, one can make it instead  a homeo $G:[0,1) \to [0,+\infty)$. (Alternatively, such modification $G$ can be made starting from the original $g$, see below).
In this case, the function  $h(x):=x+G(x)$   is therefore a differentiable, strictly increasing homeo $[0,1)\to [0,+\infty)$ everywhere differentiable with $h'(x)=1$ in a dense $G_\delta$ set. Hence the inverse map $f$ is an increasing homeo $[0,+\infty)\to[0,1)$ with derivative $1$ on a dense $G_\delta$ set. (It may be a bit technical to make this set contain the rationals as required).
How to make an unbounded Pompeiu function: start  from the original Pompeiu function $g:[0,1]\to[0,1]$, where we can assume $g(0)=g'(0)=0$, so that we can extend it on the left to a differentiable function vanishing identically for $x\le0$.
Define, for any $0\le x<1$, and with coefficients $c_n>0$ large enough to make the sum unbounded
$$G(x):=\sum_{n=1}^\infty  c_n g\big(x-1+{1\over n}\big)  $$
This sum is locally finite for all $x\in[0,1)$, therefore defines a differentiable function on $[0,1)$, which has a derivative vanishig on a dense set, due to the funny properties of the Pompeiu derivatives: Since the derivative of each term of the sum vanishes on a dense $G_\delta$ set, their sum vanishes on the intersection, which is a dense $G_\delta$ set by Baire's theorem.
A: The answer is "no", and here is how one can adapt Pietro Majer's construction from the other answer to work with the set of rational numbers.

Step 1. We begin with the original construction of Pompeiu function. Let $q_n$ be an enumeration of rational numbers in $(0, 1)$, and define, as in the original construction,
$$ u(x) = a + b \sum_{n = 1}^\infty \frac{\sqrt[3]{x - q_n}}{2^n} \, , $$
where $a$ and $b > 0$ are chosen in such a way that $u(0) = 0$ and $u(1) = 1$. Then $u$ is increasing and differentiable in an extended sense: $u'(x) \in (0, \infty]$ exists for every $x \in [0, 1]$, and $u'(x) = \infty$ for every rational $x \in (0, 1)$.

Step 2. We now define
$$ v(x) = u\biggl(\frac{1}{2} + \frac{x}{1 + 2 |x|}\biggr) . $$
Observe that $x \mapsto 1/2 + x / (1 + 2 |x|)$ is differtentiable with everywhere positive derivative, and it maps rational numbers to rational numbers. Thus, $v : \mathbb{R} \to (0, 1)$ is an increasing homeomorphism, $v$ is everywhere differentiable in the extended sense, $v'(x) \in (0, \infty]$ for every $x$, and $v'(x) = \infty$ whenever $x$ is rational.

Step 3. We now find an increasing homeomorphism $\phi : (0, 1) \to (0, 1)$ which is differentiable with everywhere positive derivative, and which has the following property: for every $s \in \mathbb{Q}$ there is $x \in \mathbb{Q}$ such that $$x + \phi(v(x)) = x.$$ Such a function $\phi$ can be constructed recursively, as follows.
We begin with $\phi_0(x) = s$. Let $r_n$ be an enumeration of all rational numbers. In step $n$ we suppose that we have already constructed a function $\phi_{n-1}$ with the following properties: $$|\phi_{n-1}' - 1| < 3^{-1} + \ldots + 3^{-(n-1)},$$ and there are rational numbers $x_1, \ldots, x_{n-1}$ such that $$x_j + \phi_{n-1}(v(x_j)) = r_j$$ for $j = 1, \ldots, n-1$. We now define $\phi_n$ to be an appropriate "tiny" modification of $\phi_{n-1}$.
Since $\phi_{n-1}' > 0$, there is a unique number $\tilde{x}_n$ such that $$\tilde{x}_n + \phi_{n-1}(v(\tilde{x}_n)) = r_n.$$ We choose a non-negative, compactly supported, smooth function $\psi_n$ on $(0, 1)$ such that $\psi_n(v(x_j)) = 0$ for $j = 1, \ldots, n - 1$, $\psi_n(v(\tilde{x}_n)) > 0$, and $\|\psi_n'\|_\infty < 3^{-n}$. For every $\epsilon \in [0, 1)$ we have
$$\phi_{n-1}' + \epsilon \psi_n' \ge 1 - (3^{-1} + \ldots + 3^{-(n-1)} + \epsilon 3^{-n}) > 0 ,$$
and hence there is a unique solution $x$ of $$x + \phi_{n-1}(v(x)) + \epsilon \psi_n(v(x)) = r_n .$$ This solution depends continuously on $\epsilon$, and since $\psi_n(v(\tilde{x}_n)) \ne 0$, it indeed changes with $\epsilon$. By the intermediate value property, there is an $\epsilon$ such that the corresponding solution $x$ is a rational number. For this $\epsilon$ and $x$, we set
$$ \phi_n = \phi_{n-1} + \epsilon \psi_n $$
and $x_n = x$. This way, we have constructed $\phi_n$ with all the desired properties.
By construction, $\psi_n$ converges in $C^1$ to an increasing homeomorphism $\psi : (0, 1) \to (0, 1)$ with the desired properties; namely, $|\psi' - 1| < 1/2$, and $x_n + \psi(v(x_n)) = r_n$.

Step 4. We set $w(x) = \psi(v(x))$. Then $w : \mathbb{R} \to (0, 1)$ is differentiable everywhere in the extended sense, $w'(x) = \psi'(v(x)) v'(x) \in (0, \infty]$, $w'(x) = \infty$ for every rational $x$, and $$x_n + w(x_n) = r_n.$$ Now we follow Pietro Majer's argument: we set $g : (0, 1) \to \mathbb{R}$ to be the inverse function of $w$, $h(x) = g(x) + x$, and $f : \mathbb{R} \to (0, 1)$ to be the inverse function of $h$.
Clearly, $g$, $h$ and $f$ are everywhere differentiable, with $g' \geqslant 0$, $h' \geqslant 1$ and $0 < f' \leqslant 1$, respectively.
Observe that $h(w(x_n)) = g(w(x_n)) + w(x_n) = x_n + w(x_n) = r_n$. Since $w'(x_n) = \infty$ for every $n$, we have $g'(w(x_n)) = 0$, and hence $h'(w(x_n)) = 1$. Thus, $f'(r_n) = f'(h(w(x_n)) = 1 / h'(w(x_n)) = 1$. Since $r_n$ exhaust all rational numbers, $f'(x) = 1$ for every rational $x$.
