Does Thomae's function have an antiderivative? Let $f(x)=0$ if $x$ is irrational and $f(x)=1/q$ if $x=p/q\in \mathbb{Q}$, $p,q$ coprime natural numbers (restrict to $[1,2]$ to make things easier). By boundedness and as it has at most countably many discontinuous points we know that $f$ is integrable on $[1,2]$. Does it have antiderivative on such a compact? 

Here is another argument. Suppose there is an anti-derivative $F$. By Fundamental Theorem of Calculus we have $$F(x) =F(1)+\int_{1}^{x}f(t)\,dt$$ for all $x\in[1,2]$. Since $F'=f$ it follows from above equation that we have $g'=f$ where $g$ is defined by $$g(x) =\int_{1}^{x}f(t)\,dt$$ But notice that integral of Thomae function is $0$ over any interval and hence $g$ and $g'$ are both identically $0$. And this gives our contradiction as $f=g'$ is not identically zero (it is non-zero on rationals).
