TITLE: How to determine whether this function is differentiable at a point?
QUESTION [21 upvotes]: We are given the following function:
$$f(x) =     \left\{
\begin{array}{ll}
      \dfrac{x}{1+x} & x \geq 0 \\
      x^2 & x < 0 \\
\end{array} 
\right.$$
We wanted to determine whether or not $f(x)$ is differentiable at $0$. I already know that $f(x)$ is continuous at $0$ using the definition of continuity. If I am correct, to show differentiability we have to show that the following limit exists:
$f'(x)=\lim_{~h \to 0} \dfrac{f(x+h)-f(x)}{h}$. Since $f(x) = \dfrac{x}{1+x}$ at $x=0$, would it then be enough to say that the derivative of $[\dfrac{x}{1+x}]' = \dfrac{1}{(x+1)^2}$ is defined at $x=0$, and since we know that $f(x)$ is also continuous at $0$, we can say $f(x)$ is differentiable at $0$?

REPLY [29 votes]: The derivative at $0$ is given by the limit
$$\begin{align}
f'(0)&=\lim_{h\to 0}\frac{f(h)-f(0)}{h}\\\\
&=\lim_{h\to 0}\frac{f(h)}{h}
\end{align}$$
if this limit exists.  If $h>0$, then 
$$\begin{align}
f'(0)&=\lim_{h\to 0^+}\frac{\frac{h}{1+h}}{h}\\\\
&=1
\end{align}$$
If $h<0$, then
$$\begin{align}
f'(0)&=\lim_{h\to 0^-}\frac{h^2}{h}\\\\
&=0
\end{align}$$
The right-side and left-side limits are not equal.  Therefore, the derivative at $0$ does not exist.