[proofplan]
We prove the result by induction on the derivative order $m$. The base case is the standard fact that a differentiable real-valued function on an interval whose derivative vanishes everywhere is constant, obtained from the [Mean Value Theorem](/theorems/186). For the induction step, we apply the induction hypothesis to $f'$ to see that $f'$ is a polynomial of degree at most $m-2$, integrate that polynomial explicitly, and then use the base case on the difference between $f$ and the constructed antiderivative.
[/proofplan]
[step:Show that a function with zero derivative on an interval is constant]
We first record the elementary consequence of the Mean Value Theorem needed below.
[claim:Zero derivative on an interval forces constancy]
Let $J \subset \mathbb{R}$ be an interval, and let $g: J \to \mathbb{R}$ be a [continuous function](/page/Continuous%20Function) on $J$ and differentiable at every interior point of $J$. If $g'(x)=0$ for every interior point $x$ of $J$, then $g$ is constant on $J$.
[/claim]
[proof]
Let $x,y \in J$ with $x<y$. Since $J$ is an interval, $[x,y] \subset J$. The restriction $g|_{[x,y]}: [x,y] \to \mathbb{R}$ is continuous on $[x,y]$ and differentiable on $(x,y)$. By the Mean Value Theorem, there exists $c \in (x,y)$ such that
\begin{align*}
g(y)-g(x)=g'(c)(y-x).
\end{align*}
Since $g'(c)=0$, this gives $g(y)=g(x)$. Because any two distinct points of $J$ can be ordered in this way, and equal points have equal values by reflexivity of equality, $g$ is constant on $J$.
[/proof]
[guided]
We need a precise way to pass from the pointwise condition $g'=0$ to a global statement about all values of $g$. Let $x,y \in J$ with $x<y$. The interval hypothesis is essential here: it gives $[x,y] \subset J$, so the restriction $g|_{[x,y]}: [x,y] \to \mathbb{R}$ is a legitimate function on a closed interval.
The Mean Value Theorem applies to $g|_{[x,y]}$ because $g$ is continuous on $J$, hence continuous on $[x,y]$, and differentiable at every interior point of $J$, hence differentiable on $(x,y)$. Therefore there exists $c \in (x,y)$ satisfying
\begin{align*}
g(y)-g(x)=g'(c)(y-x).
\end{align*}
The hypothesis gives $g'(c)=0$, so
\begin{align*}
g(y)-g(x)=0.
\end{align*}
Thus $g(y)=g(x)$. Since this holds for every ordered pair $x<y$ in $J$, the function $g$ has the same value at every point of $J$. Hence $g$ is constant on $J$.
[/guided]
[/step]
[step:Prove the polynomial representation by induction on the derivative order]
We prove the theorem for every $m \in \mathbb{N}$ by induction on $m$.
For $m=1$, the hypothesis is $f'(x)=0$ for every $x \in I$. Applying the claim with $J=I$ and $g=f$, there exists $a_0 \in \mathbb{R}$ such that
\begin{align*}
f(x)=a_0
\end{align*}
for every $x \in I$. This is the required representation
\begin{align*}
f(x)=\sum_{i=0}^{0} a_i x^i.
\end{align*}
Assume now that $m \geq 2$ and that the result is known for $m-1$. Let $f \in C^m(I;\mathbb{R})$ satisfy $f^{(m)}(x)=0$ for every $x \in I$. Define the derivative function
\begin{align*}
h: I \to \mathbb{R}, \quad h(x)=f'(x).
\end{align*}
Since $f \in C^m(I;\mathbb{R})$, we have $h \in C^{m-1}(I;\mathbb{R})$, and
\begin{align*}
h^{(m-1)}(x)=f^{(m)}(x)=0
\end{align*}
for every $x \in I$. By the induction hypothesis applied to $h$, there exist [real numbers](/page/Real%20Numbers) $b_0,\dots,b_{m-2} \in \mathbb{R}$ such that
\begin{align*}
h(x)=\sum_{i=0}^{m-2} b_i x^i
\end{align*}
for every $x \in I$.
Define the polynomial antiderivative
\begin{align*}
Q: \mathbb{R} \to \mathbb{R}, \quad Q(x)=\sum_{i=0}^{m-2} \frac{b_i}{i+1}x^{i+1}.
\end{align*}
By the ordinary differentiation rule for monomials and finite sums,
\begin{align*}
Q'(x)=\sum_{i=0}^{m-2} b_i x^i
\end{align*}
for every $x \in \mathbb{R}$. Define
\begin{align*}
r: I \to \mathbb{R}, \quad r(x)=f(x)-Q(x).
\end{align*}
Since $f \in C^m(I;\mathbb{R})$ and $m \geq 2$, the function $f$ is continuous on $I$ and differentiable at every interior point of $I$. Since $Q$ is a polynomial function on $\mathbb{R}$, the function $Q|_I: I \to \mathbb{R}$ is continuous on $I$ and differentiable at every interior point of $I$. Hence $r=f-Q|_I$ is continuous on $I$ and differentiable at every interior point of $I$. For every interior point $x$ of $I$,
\begin{align*}
r'(x)=f'(x)-Q'(x)=h(x)-h(x)=0.
\end{align*}
Applying the claim to $r$, there exists $a_0 \in \mathbb{R}$ such that $r(x)=a_0$ for every $x \in I$. Therefore
\begin{align*}
f(x)=a_0+\sum_{i=0}^{m-2} \frac{b_i}{i+1}x^{i+1}
\end{align*}
for every $x \in I$.
For each integer $j$ with $1 \leq j \leq m-1$, define
\begin{align*}
a_j=\frac{b_{j-1}}{j}.
\end{align*}
Together with the constant $a_0$ above, this gives real numbers $a_0,\dots,a_{m-1}$ satisfying
\begin{align*}
f(x)=\sum_{j=0}^{m-1} a_j x^j
\end{align*}
for every $x \in I$. This completes the induction.
[guided]
We now prove the theorem for every positive integer $m$ by induction. The statement has no $m=0$ case, because the formalized statement specifies $\mathbb{N}=\{1,2,3,\dots\}$.
For $m=1$, the hypothesis says $f'(x)=0$ for every $x \in I$. The function $f$ belongs to $C^1(I;\mathbb{R})$, so it is continuous on $I$ and differentiable at every interior point of $I$. Therefore the zero-derivative claim applies with $J=I$ and $g=f$. It gives a real number $a_0 \in \mathbb{R}$ such that
\begin{align*}
f(x)=a_0
\end{align*}
for every $x \in I$. Since the only summand in $\sum_{i=0}^{0} a_i x^i$ is $a_0x^0=a_0$, this is exactly the desired representation for $m=1$.
Assume now that $m \geq 2$ and that the theorem has already been proved for the positive integer $m-1$. Let $f \in C^m(I;\mathbb{R})$ satisfy $f^{(m)}(x)=0$ for every $x \in I$. The natural object to which the induction hypothesis can be applied is the first derivative of $f$, because differentiating $f'$ exactly $m-1$ times gives the $m$th derivative of $f$. Define
\begin{align*}
h: I &\to \mathbb{R}
\end{align*}
by setting $h(x)=f'(x)$ for $x \in I$. Since $f \in C^m(I;\mathbb{R})$, its first derivative satisfies $h \in C^{m-1}(I;\mathbb{R})$. For every $x \in I$,
\begin{align*}
h^{(m-1)}(x)=f^{(m)}(x)=0.
\end{align*}
Thus the induction hypothesis applies to $h$. Hence there exist real numbers $b_0,\dots,b_{m-2} \in \mathbb{R}$ such that
\begin{align*}
h(x)=\sum_{i=0}^{m-2} b_i x^i
\end{align*}
for every $x \in I$.
We now build an explicit polynomial antiderivative of this polynomial expression for $h$. Define
\begin{align*}
Q: \mathbb{R} &\to \mathbb{R}
\end{align*}
by
\begin{align*}
Q(x)=\sum_{i=0}^{m-2} \frac{b_i}{i+1}x^{i+1}.
\end{align*}
By the ordinary differentiation rule for monomials and finite sums,
\begin{align*}
Q'(x)=\sum_{i=0}^{m-2} b_i x^i
\end{align*}
for every $x \in \mathbb{R}$. In particular, for every $x \in I$, we have $Q'(x)=h(x)=f'(x)$.
Define the remainder function
\begin{align*}
r: I &\to \mathbb{R}
\end{align*}
by setting $r(x)=f(x)-Q(x)$ for $x \in I$. Since $f \in C^m(I;\mathbb{R})$ and $m \geq 2$, the function $f$ is continuous on $I$ and differentiable at every interior point of $I$. Since $Q$ is a polynomial function on $\mathbb{R}$, its restriction $Q|_I: I \to \mathbb{R}$ is continuous on $I$ and differentiable at every interior point of $I$. Therefore $r=f-Q|_I$ is continuous on $I$ and differentiable at every interior point of $I$. For every interior point $x$ of $I$,
\begin{align*}
r'(x)=f'(x)-Q'(x)=h(x)-h(x)=0.
\end{align*}
The zero-derivative claim applies to $r$, so there exists $a_0 \in \mathbb{R}$ such that $r(x)=a_0$ for every $x \in I$. Hence
\begin{align*}
f(x)=a_0+\sum_{i=0}^{m-2} \frac{b_i}{i+1}x^{i+1}
\end{align*}
for every $x \in I$.
It remains only to rewrite the coefficients with the indexing used in the theorem statement. For each integer $j$ with $1 \leq j \leq m-1$, define
\begin{align*}
a_j=\frac{b_{j-1}}{j}.
\end{align*}
Together with the constant $a_0$ obtained from the zero-derivative claim, these real numbers satisfy
\begin{align*}
f(x)=\sum_{j=0}^{m-1} a_j x^j
\end{align*}
for every $x \in I$. This proves the induction step, and therefore the theorem holds for every positive integer $m$.
[/guided]
[/step]