Zero Derivative implies Constant Function

Theorem
Let $f$ be a real function which is continuous on the closed interval $\left[{a \,. \, . \, b}\right]$ and differentiable on the open interval $\left({a \, . \, . \, b}\right)$.

Suppose that $\forall x \in \left({a \, . \, . \, b}\right): f^{\prime} \left({x}\right) = 0$.

Then $f$ is constant on $\left[{a \,. \, . \, b}\right]$.

Proof
Let $y \in \left[{a \,. \, . \, b}\right]$.

Then $f$ satisfies the conditions of the Mean Value Theorem on $\left[{a \,. \, . \, y}\right]$.

Hence $\exists \xi \in \left({a \, . \, . \, y}\right): f^{\prime} \left({\xi}\right) = \dfrac {f \left({y}\right) - f \left({a}\right)} {y - a}$.

But $f^{\prime} \left({\xi}\right) = 0$ and hence $f \left({y}\right) = f \left({a}\right)$.

As $y$ is any $y \in \left[{a \,. \, . \, b}\right]$, the result follows.