Problem: Let $f: \mathbb R -> \mathbb R$ be given by $f(x):= x.|x|$. Show that $f$ is continuous and differentiable on $\mathbb R$.
My solution:
By using the Differentialquotient we prove that $f$ is differentiable $ lim_{x\to x_0} = \left(\frac{ x.|x| - (x_0 .|x_0|)} {x-x_0}\right) =\left(\frac{(x-x_0).(|x|-|x_0|)} {x-x_0}\right)=|x|-|x_0|=|x|$
And as the function is differentiable, we know that then the function is continuous $ lim_{x\to x_0}= (x.|x|) - (x_0 .|x_0|)= ( |x|- 0) - (x -0)=|x|-x =0$
So is my solution right? And if you want to prove that a function is differentiable is it enough to do it this way? Or for my case do you have to prove that the function is differentiable at $x<0$, $x>0$ and $x=0$ in order to prove that the function is at whole differentiable on $\mathbb R$ ?
So if I prove if the function is differentiable at $x<0$, $x>0$ and $x=0$.
For $x>0$ I get $ lim_{x\to x_0}=\left(\frac{-x^2+x_0^2} {x-x_0}\right)=-(x+x_0)=-x$
For $x>0$ I get $ lim_{x\to x_0}=\left(\frac{x^2-x_0^2} {x-x_0}\right)=(x+x_0)=x$
For $x=0$ I get $ lim_{x\to x_0}=\left(\frac{0-0} {x-x_0}\right)=0$