Let $f\in C^1([a,b],\mathbb{R})$ such as $\dfrac{f(b)-f(a)}{b-a}=\sup\left\{f^{'}(x) : x\in[a,b]\right\}$. Prove that $f$ is linear
Proving that $f$ is linear means to prove that $\forall x\in [a,b],\, f^{'}(x) = \dfrac{f(b)-f(a)}{b-a}$. Because $f\in C^1$ then $\exists M\in[a,b],\,\dfrac{f(b)-f(a)}{b-a}=f^{'}(M)$. So $\forall x\in[a,b],\,f^{'}(x)\leq f{'}(M).$
From here I can see that I have to prove that $f{'}(x)\geq f{'}(M),$ But I can't quite see the continuation of this proof. Although I can graphically see by plotting some graphs that if $f$ was not linear then eventually there would be a point where $\dfrac{f(b)-f(a)}{b-a}$ is not a supremum.