$$f(x) = \begin{cases} x^2\sin(1/x), & \text{if $x$ $\neq$ 0} \\ 0, & \text{if $x$ = 0} \end{cases}$$
Ok, as far as I know, to test if a function is continuous at $0$, the $\lim_{x \to 0} \ f(x) = f(0) $ has to exist if $x→0$ , this means that x is different than $0$ , so in this case $f(x)$ = $x^2\sin(1/x)$ , and the limit above exists and equals to $0$. (I think)
How do I derive a piecewise function? I though that i could derive $x^2\sin(1/x) $ after that, $0$. For example, the derivative of
$$f(x) = \begin{cases} x, & \text{if $x$ $≥$ 0} \\ -x, & \text{if $x$ < 0} \end{cases}$$ would be
$$f'(x) = \begin{cases} 1, & \text{if $x$ $≥$ 0} \\ -1, & \text{if $x$ < 0} \end{cases}$$
and $f'(0)$ $= 1$, but this can't be right because the derivative of |x| at $0$ doesn't exist. (i hope I made myself clear with this example)
The exercise asks if the derivative at $0$ exists. Sorry if it caused confusion, i wanna know the derivative at $0$ to the first function and not the $|x|$.
It is the graph of $x^2\sin(1/x)$ and you can draw only one tangent at $0$.If a function is differentiable it must has unique target at the desired point. The second function has no derivative at $0$ as you see that you can draw two tangents at $0$ whose slops are $1$ and $-1$ (you have done it in your question).To make it clear just draw this function and then draw those tangents at $0$.