I’m actually referring to another a question from here: Sufficient condition to show $f$ is monotonically increasing in some neighborhood
I know a counterexample has already been given, but I still do not fully understand why or how it is necessary for f’(x) to be continuous. Why does it have to be continuous in the whole interval, and not just at point x?
Actually I initially thought differentiability of f(x) was sufficient. Below is my reasoning.
Let $f : \left[a,b\right] \to \Bbb R$ be differentiable at some $c \in \left(a,b\right)$, with $f’(c) > 0$. Then,
$$\lim_{x\to c}\frac{f(x) - f(c)}{x - c} = L \gt 0$$
So for $\epsilon = L \gt 0, \exists \delta \gt 0 :$
$$\left|x - c\right| \lt \delta \Rightarrow \left| \frac{f(x) - f(c)}{x - c} - L\right| \lt L \Rightarrow 0 \lt \frac{f(x) - f(c)}{x - c} \lt 2L$$
So when $-\delta \lt x - c \lt 0 \Rightarrow x \lt c$, and as $\frac{f(x) - f(c)}{x - c} \gt 0 \Rightarrow f(x) - f(c) \lt 0 \Rightarrow f(x) \lt f(c)$. Similarly when $0 \lt x - c \lt \delta \Rightarrow x \gt c$ and $f(x) \gt f(c)$. Hence we have found a neighbourhood $\left|x - c\right| \lt \delta$ in which $f(x)$ is increasing monotonically
Can someone please point out where I went wrong?