Why can a discontinuous function not be differentiable?

Solution 1:

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$.

Solution 2:

You are computing $\lim_{x\rightarrow 0_{\pm}}f'(x)$ rather than $$\lim_{h\rightarrow 0^\pm}\frac{f(0+h)-f(0)}{h}.$$