Differentiabillity and continuity If I have a function like $f(x)= \left\{\begin{array}{lr}
        2, & \text{for } x>0\\
        -2, & \text{for } x\leq0
        \end{array}\right\}$
it is obviously not continuous in $x=0$.  But if I take the left limit for the derivative and the right lit for the derivative at, they are both 0. That would imply that the function is differentiable but not continuous at 0. How can that be?
 A: The derivative from the right at $0$ $$\lim_{x\to0^+}\dfrac{f(x)-f(0)}{x-0}=\lim_{x\to0^+}\dfrac{2-(-2)}{x}=\lim_{x\to0^+}\dfrac{4}{x}=\infty,$$ i.e. it doesn't exist.
A: The right derivative is NOT $0$, it is infinite. Can you see why?
A: Just because $\lim_{x\to0^-}f'(x)=\lim_{x\to 0^+}f'(x)$ does not mean that the function is differentiable at $0$.  Remember that 
$$f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}h.$$
If you try to compute this limit with your function at $0$, you will find that it does not exist.
A: You have
$$
\lim_{x\,\uparrow\,0} f'(x) = 0 \text{ and } \lim_{x\,\downarrow\,0} f'(x) = 0.
$$
Then you made a giant leap to the conclusion that $f'(0)=0$.  That is certainly true if $f'$ is continuous at $0$, but you haven't shown that, nor can you, since in this case it's not true.  Even with the weaker assumption that $f'$ exists at $0$ you can prove that conclusion (I seem to recall that this requires Darboux's theorem.).
But
$$
f'(0) = \lim_{h\to0}\frac{f(0+h) - f(0)} h
$$
if that limit exists.  Try working with that and you'll see that this last limit does not exist.
