Q:

proving that $g(x)=|x|f(x)$ derivable iff $f(0)=0$ in $x_0=0$

Having problem with it, but first I'll explain the question.
I'm asked to prove that $g(x)=|x|f(x)$ is derivable in $x_0=0$ iff $f(0)=0$, while $f$ is a continuous function $x_0=0$.
Basically since $f(x)=|x|$ is not derivable in $x=0$, it might seem like a problem, but I think that the definition of whether a function is derivable or not is that if its limit exists, i.e: $f'(x_0) = \lim_{x\to x_0} \frac{f(x)-f(x_0)}{x-x_0}$. so basically since $|x|$ changes the pluses to minuses at times, the only opportunity where the definition will hold is when $x=0$. Is it true? and how should I write it mathematically?
thank you in advance

A:

$g $ differentiable at $x=0 \iff$
$$ \lim_{x\to 0^+}\frac {g (x)-g (0)}{x}=\lim_{x\to 0^-}\frac {g (x)-g (0)}{x}$$
$$\iff \lim_{x\to0^+}\frac {xf (x)-0}{x}=\lim_{x\to0^-}\frac {-xf (x)}{x} $$
$$\iff f (0)=-f (0)=0$$

