I saw a question on stackexchange earlier today about the function $f(x)=\begin{cases} 1&\text{if }x\in\mathbb{Q}\\ 0&\text{otherwise.} \end{cases}$
It reminded me of an old problem (that I don't think I solved), and I thought it was worth sharing with others. Let \begin{equation*} g(x)=\begin{cases} \frac{1}{q^j}&\text{if }x\in\mathbb{Q}\\ 0&\text{otherwise.} \end{cases} \end{equation*} For rational values of $x$, we have $x=\frac{p}{q}$ is in lowest terms. Additionally, $j> 1$.
1) One of the questions that was asked was to show the following: $g$ is differentiable for $x\in\mathbb{R}\setminus\mathbb{Q}$.
I don't think this is very difficult; however, I had trouble with the next one:
2) Show that $g$ is $k$-times differentiable for $x\in\mathbb{R}\setminus\mathbb{Q}$ and $k How do we prove (2)? Is it even true? For the second derivative, we take
\begin{equation*}
f''(x)=\lim_{h\to 0}\frac{f(x+h)-2f(x)+f(x-h)}{h^2}
\end{equation*} I'm not totally sure how one might extend to higher derivatives, and a quick google search did not yield what I was looking for! I would be happy if there was a proof for $k=2$ in my question.