I am looking at functions from $\mathbb{R}$ or an open set of it to $\mathbb{R}$ which send rational numbers to rational numbers i.e. $f(\mathbb{Q}) \subseteq \mathbb{Q}$. I will call such functions $\mathbb{Q}$-functions.
I am looking at derivatives and asking whether a $\mathbb{Q}$-function which is differentiable (in the usual real sense) can have a derivative which is not a $\mathbb{Q}$-function.
To illustrate the question, consider the similar one for anti-derivatives. In this case, the answer is that a $\mathbb{Q}$-function might have an anti-derivative which is not a $\mathbb{Q}$-function. An example is $f(x) = \frac{1}{x}$ on $(0, \infty)$. The anti-derivative is $\log(x) + C$ and no choice of $C$ makes this a $\mathbb{Q}$-function.
Back to derivatives, I have failed to find such an example. I did some research and I found a Math Overflow answer which said that a continuous $\mathbb{Q}$-function is either piecewise rational or highly irregular. Unfortunately, I cannot find it again to check whether I understood it correctly. If it is correct then the answer to my question is that the derivative of a differentiable $\mathbb{Q}$-function will also be a $\mathbb{Q}$-function.