# Derivative of function defined on only rational numbers

Let $f:\mathbb{Q}\to\mathbb{R}$ be uniformly continuous and assume that $f':\mathbb{Q}\to\mathbb{R}$ is uniformly continuous as well. Let $a$ be an irrational number. I need help to prove that

$$\lim_{q\to a}f'(q)=\lim_{q\to a}\frac{(\lim_{p\to a}f(p))-f(q)}{a-q}$$

Motivation for the question: $f'(a)$ does not exist, but both the left-hand side and the right-hand side of the equation is an intuitively reasonable substitute for it: on the LHS we first differentiate and then take the limit to $a$, and on the RHS we first take the limit to $a$ and then differentiate. It would therefore be nice to prove that they are equal.

• I don't think such a function can exist?. You can't have a function whose points of continuity are solely the rationals Commented Dec 25, 2016 at 19:07
• @David: Yes, it can. Continuity is defined using the limit concept, and a limit is defined by quantification over the function values in a neighbourhood of the point in question. When the function is defined only on rational numbers, there are less numbers to quantify over, so it's "easier" for the function to be continuous. I think you are confusing a function being defined on only rational numbers and being continuous with a function being defined on all real numbers and being continuous on only rational numbers. Commented Dec 25, 2016 at 19:21
• You're right, that's the conclusion I came to myself. It's interesting, by all definitions of continuity it works, but intuitively (considering the visuals) it doesn't seem continuous at all. But yes, I was wrong Commented Dec 25, 2016 at 19:23

It turns out that there is a very good reason I couldn't prove it: the proposition is false! Minkowski's_question_mark_function is a counter-example. For all rational $q$, $f'(q)$ is $0$, so the LHS of my equation is also always $0$. But there are irrational $a$ such that the RHS is not.