# Zero derivative implies locally constant

Suppose $f$ is a function and $I$ is an interval (possibly open, closed, or half-open and half-closed) contained inside the domain of $f$such that $f'(x) = 0$ for all $x$ in the interior of $I$ and $f$ is continuous on all of $I$ (note that we do not require differentiability, or even one-sided differentiability, at the endpoints of $I$, if any). Then, $f$ is a constant function on all of $I$, i.e. there is a real number $C$ such that $f(x) = C$ for all $x \in I$.