[Math] Why is this function only differentiable at zero

calculusderivativeslimits

In my analysis class, we had the following function:
$$f: \mathbb{R} \to \mathbb{R}: x \mapsto \begin{cases}
x^2 & \text{ if } x \in \mathbb{Q}\\ -x^2 & \text{elsewhere}.\end{cases}$$

At zero, I can see that this function is differentiable: indeed, we have that
$$\lim_{h \to 0}\Big|{\frac{f(h) -f (0)}{h}}\Big| = \lim_{h \to 0}|h| = 0$$
by continuity of the absolute-value function and therefore, the limit of $h \to 0$ of the quotients also equals zero.

My course notes then state that this function is nowhere differentiable except at zero. At this point, I only know about continuity and the definition of differentiability. Another example of my course notes used a sequence converging to zero, such that the quotient in the definition of derivative does not converge or has no limit. Therefore, I tried doing the same, but without result… Any hints on how to solve this?

Note that I do know that this function is not continuous (except at zero), but I have not seen the result (differentiable implies continuous) yet, so I'm sure the lecture notes do not intend to use this result…

Best Answer

Consider the point $1$, for instance. In order to prove that $f$ is not differentiable there, you have to prove that the limit $\lim_{x\to1}\frac{f(x)-1}{x-1}$ doesn't exist. Note that there are numbers arbitrarily close to $1$ whose square is irrational. For such a point $x$, $f(x)$ is close to $-1$, and therefore $\left\lvert\frac{f(x)-1}{x-1}\right\rvert$ must be a very large number. It is not hard to formalize this in order to prove that the limit $\lim_{x\to1}\frac{f(x)-1}{x-1}$ doesn't exist indeed.

The argument is similar at the other points of $\mathbb{R}\setminus\{0\}$.