# Continuity versus Differentiability

There is a close relatioship between continuity and differentiability, namely

Theorem 18. If $f’(x_0)$ exists then $f(x)$ is continuous at $x_0$; i.e. $\displaystyle\lim_{x\to x_0}f(x)=f(x_0)$. However the converse need not be true.

Proof. \begin{eqnarray*}\lim_{x\to x_0}[f(x)-f(x_0)]&=&\lim_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}\cdot(x-x_0)\\&=&f’(x)\cdot 0\\&=&0.\end{eqnarray*}

Example. [A Counterexample for the Converse] The function $f(x)=|x|$ is continuous at $x=0$ but has no derivative at $x=0$.

Proof. \begin{eqnarray*}\lim_{x\to 0+}\frac{f(x)-f(0)}{x-0}&=&\lim_{x\to 0+}\frac{|x|}{x}\\&=&\lim_{x\to 0+}\frac{x}{x}\\&=&1,\end{eqnarray*} while \begin{eqnarray*}\lim_{x\to 0-}\frac{f(x)-f(0)}{x-0}&=&\lim_{x\to 0-}\frac{|x|}{x}\\&=&\lim_{x\to 0-}\frac{-x}{x}\\&=&-1.\end{eqnarray*} Hence, $f’(0)=\displaystyle\lim_{x\to 0}\frac{f(x)-f(0)}{x-0}$ does not exist.