As homework we were given 2 questions:
Find a function that is continuous at exactly one point and not differentiable there.
Find a function that is differentiable at exactly two points.
The answer to the first one was somewhat simple - $ f(x) = x*D(x) $, wherein $ D(x) $ stands for Dirichlet function.
I've been thinking about the second question for a while, and someone suggested me the following: $ g(x) = x^2*D(x) $
$ f(x) = (x-1)^2 * g(x) $
Claiming that $f(x)$ is only differentiable in $ x = 0, x = 1 $. Why is that?
It is simplier to say that$$g(x)=\begin{cases}x^2(x-1)^2&\text{ if }x\in\mathbb Q\\0&\text{ otherwise.}\end{cases}$$And, yes, this example works. Outside $\{0,1\}$, $g$ is discontinuous, and therefore non-differentiable. And it follows from the definition of $g'$ that $g'(0)=g'(1)=0$.