1Continuing with the Mean Value Theorem¶
Corollary: Let $I = [a,b]$ be a closed and bounded interval, $f : I \to \mathbb{R}$ continuous on $[a,b]$ and differentiable on $(a,b)$. Then
(i) $f$ is increasing on $I \iff f'(c) \geq 0$ for all $x \in I$
(ii) $f$ is decreasing on $I \iff f'(c) \leq 0$ for all $x \in I$
Proof: We'll prove the first, as the second is pretty much the same.
($\Leftarrow$) Let $x_1, x_2 \in I$ be such that $x_1 < x_2$. Apply the Mean Value Theorem to $f$ on $[x_1,x_2]$. Then there exists $c \in (x_1, x_2)$ such that $\displaystyle\frac{f(x_2) - f(x_1)}{x_2 - x_1} = f'(c)$. Then $\displaystyle\frac{f(x_2) - f(x_1)}{x_2 - x_1} \geq 0$. Multiply by $x_2 - x_1 > 0$ to get that $f(x_2) - f(x_1) \geq 0$, i.e. $f(x_1) \leq f(x_2)$, i.e. $f$ is increasing on $I$.
($\Rightarrow)$ If $f$ is increasing, for fixed $c \in (a,b)$ and $c < x$ then $f(c) \leq f(x)$ so $f(x) - f(c) \geq 0$ and $\displaystyle\frac{f(x) - f(c)}{x-c} \geq 0$. But $\displaystyle\frac{f(x)-f(c)}{x-c} \to f'(c)$ as $x \to c$, thus $f'(c) \geq 0$.
As we mentioned, (ii) follows similarly.
Lemma: Let $I \subseteq \mathbb{R}$ be an interval, $f : I \to \mathbb{R}$ be a function on $I$ differentiable at $c \in I$.
(i) if $f'(c) > 0$, there exists $\delta > 0$ such that $f(x) > f(c)$ for all $c < x < c + \delta$.
(ii) if $f'(c) < 0$, there exists $\delta > 0$ such that $f(x) > f(c)$ for all $c-\delta < x < c$.
Proof: We'll prove the first as the second follow similarly. Using essentially the same proof as the previous corollary: let $c \in I$ be such that $f'(c) > 0$. There exists $\delta > 0$ such that if $0 < |x-c|<\delta$ then $\displaystyle\frac{f(x)-f(c)}{x-c} > 0$ if $x-c > 0$, i.e. if $x$ is such that $c < x < c+\delta$ then $\displaystyle\frac{f(x)-f(c)}{x-c} > 0$. Multiplying by $x-c>0$ gives us $f(c) < f(x)$.
As we mentioned, (ii) follows similarly.
This leads us to Darboux's Theorem:
Theorem: (Darboux's) Let $f$ be differentiable on $I = [a,b]$, a closed and bounded interval. If there exists $k \in \mathbb{R}$ between $f'(a)$ and $f'(b)$ then there exists $c \in (a,b)$ such that $f'(c) = k$.
Proof: Suppose WLOG that $f'(a) < k < f'(b)$. Define $g(x) = kx - f(x)$. $g(x)$ is also differentiable on $I$. In particular, $g$ is continuous on $I$, so $g(x)$ attains a maximum on $I$. $g'(a) = k - f'(a) > 0$. Thus by the previous lemma, the maximum is not attained at $x = a$. Similarly, $g'(b) = k - f'(b) < 0$, so again the maximum of $g$ is not attained at $b$. Let $c \in (a,b)$ be the point where $g$ attains its maximum by the theorem. As we saw last time, $g'(c) = 0 = k - f'(c)$, i.e. $f'(c) = k$.
Here is a nice application of the above theorem: imagine being given some function $g(x)$ defined by:
$$ g(x) = \left\{ \begin{array}{rl} -1 & : x \in [-1,0)\\ 0 & : x = 0 \\ 1 & : x \in (0, 1] \end{array} \right. $$
Is $g$ the derivative of some function $f$ on $[-1,1]$? No! (emphasis via the prof) by Darboux's theorem.