Consider the function$$f\left( x \right) =\begin{cases}0,x\in \mathbb{Q} ^c\\a_n,x=\frac{m}{n}\in \mathbb{Q}\\\end{cases}$$where $(m,n)=1$. My question is, when is $f$ differentiable over $\mathbb{Q}^c$?
My attempts: Classical Riemann function (i.e. $a_n=\frac{1}{n}$) seem to fail, and $a_n=\frac{1}{n^2}$ does not work either. By Liouville's approximation theorem I managed to show that the function is derivative over algebraic numbers provided $n^k|a_n|\to 0$ for some $k\ge 2$. I wonder if there are more general results. Thanks in advance.