Consider the function $$ f(x)=\begin{cases} x & \textrm{if } x \textrm{ is rational} \\ -x & \textrm{if } x \textrm{ is irrational} \end{cases} $$ It is well-known that $f(x)$ is continuous at $x=0$, and discontinuous everywhere else. Now, let's consider the modified function: $$ g(x)=\begin{cases} x^3 & \textrm{if } x \textrm{ is rational} \\ -x^3 & \textrm{if } x \textrm{ is irrational} \end{cases} $$ Then, $g(x)$ will be again continuous at $x=0$. But I am wondering:
Is $g(x)$ differentiable at $x=0$?
I think the answer might be 'yes', because by introducing the higher power $x^3$, we have "smoothed out" the behaviour of the function around the origin. On the other hand, the function looks too pathological to admit any points of differentiability.
For all $x\neq 0$ the following holds:
$$\dfrac{g(x)-g(0)}{x-0}=\dfrac {g(x)}x=\begin{cases} x^2, &\text{if }x\in \mathbb Q\\ -x^2, &\text{if }x\not \in \mathbb Q\end{cases},$$
therefore $$\lim \limits_{x\to 0}\left(\dfrac{g(x)-g(0)}{x-0}\right)=\underline ?$$ and $g'(0)=\underline ?$.