Define $f$ on $[0,1]$ by setting $f(x)=0$ if $x$ is irrational and $\frac 1q$ if $x=\frac pq$ is rational with $p,q$ in lowest terms. Determine if $f$ is differentiable.
My attempt: this function is not continuous over the rational numbers. hence it is not differentiable over $\mathbb{Q}$.
For $x_0\notin \mathbb{Q}$ we have: $$\lim_{x\to x_0}\dfrac{f(x)-f(x_0)}{x-x_0}=\lim_{x\to x_0}\dfrac{f(x)}{x-x_0}$$
I am not sure how to proceed.
Edit : I need to check if the limit converges: Let L be a number in $\mathbb R$, I will only check differentiabilty at irrational points $\implies f(x_0)=0$ $$|\dfrac{f(x)-f(x_0)}{x-x_0}-L|=|\dfrac{f(x)-L(x-x_0)}{x-x_0}| $$ For the above to be less than $\epsilon$, I need to choose an appropriate $\delta$.
For any $\delta$ the interval $(x_0-\delta,x_0+\delta)$ will contain rational and irrational points.
hence, $\exists x'\in (x_0-\delta,x_0+\delta)$ such that $x'\notin \mathbb Q$. In this case: $$|\dfrac{f(x)}{x-x_0}|=|L| $$
Also, $\exists x'\in (x_0-\delta,x_0+\delta)$ such that $x'\in \mathbb Q$. In this case:
$$|\dfrac{f(x)-f(x_0)}{x-x_0}-L|=|\dfrac{f(x)}{x-x_0}-L|= |\dfrac{\frac{1}{q}}{\frac{p}{q}-x_0}-L|$$
Am I correct so far?
Irrationals are dense in reals so every rational can be approximated by a sequence of irrational numbers. But the limit does not match as $0 \neq 1/q$. So the function is not continuous at rationals. f is certainly not differentiable at rationals. I think the function is continuous at irrationals because to reach an irrational the denominator must get bigger and bigger so $1/q$ tends to $0$.It is not differentiable there (easy to see).