[Math] Why can a discontinuous function not be differentiable

calculuscontinuityfunctions

I don't really understand why a discontinuous function cannot be differentiable.

In Stewart's Calculus, the definition of a function $f$ being differentiable at $a$ is that $f'(a)$ exists. Earlier it gives the definition of the derivative as $f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$. It also has a theorem that if $f$ is differentiable at $a$, then $f$ is continuous at $a$. There is also a definition that a functions $f$ is continuous at a number $a$ if $\lim_{x\to a}f(x)=f(a)$.

Take for example the very simple function:

$$
f(x)=\begin{cases}
x+1 & x\geq0, \\
x & x<0.
\end{cases}
$$

It is discontinuous at $x=0$ (the limit $\lim_{x\to 0}f(x)$ does not exist and so does not equal $f(0)$), but if I find the derivative using the limit above, I get the left and right limits to equal $1$. So therefore, the derivative exists.

According to the book, the function shouldn't be differentiable at $x=0$ as it has a discontinuity (continuity is a necessary condition of differentiability). What am I doing/understanding wrong?

Best Answer

Computing the derivative from the left gives you $$ \lim\limits_{h\rightarrow0^-} {f(0+h)-f(0)\over h } =\lim\limits_{h\rightarrow0^-} {h-1\over h }=\infty. $$ (In particular, note $f(0)=1$, not $0$.)

You can also see the derivative from the left doesn't exist (as a real number) by considering slopes of secant lines. Note a secant line has one endpoint at the point $(0,1)$ and the other at a point $(h,h)$ with $h<0$. As $h$ tends to $0$, the slopes tend to $\infty$.