[proofplan]
We first prove the calculus rule for a single monomial $x \mapsto x^n$ directly from the difference quotient, using the finite factorisation of $y^n-x^n$. Continuity of each monomial follows from the same factorisation. Since $p$ and $P$ are finite linear combinations of monomials, the derivative of each polynomial is obtained by passing the limit through a finite sum.
[/proofplan]
[step:Compute the derivative of each monomial from the difference quotient]
For each $n \in \mathbb{N} \cup \{0\}$, define the monomial function $m_n: \mathbb{R} \to \mathbb{R}$ by
\begin{align*}
m_n(x)=x^n.
\end{align*}
When $n=0$, $m_0$ is the constant function $1$, so it is continuous and differentiable on $\mathbb{R}$ with $m_0'(x)=0$ for every $x \in \mathbb{R}$.
Let $n \in \mathbb{N}$ and fix $x \in \mathbb{R}$. For every $y \in \mathbb{R}$ with $y \ne x$, the algebraic factorisation of a difference of powers gives
\begin{align*}
\frac{m_n(y)-m_n(x)}{y-x}=\sum_{j=0}^{n-1} y^{n-1-j}x^j.
\end{align*}
As $y \to x$, each term $y^{n-1-j}x^j$ tends to $x^{n-1}$, because multiplication by the fixed scalar $x^j$ preserves limits and $y^{n-1-j} \to x^{n-1-j}$. Since the sum is finite,
\begin{align*}
\lim_{y \to x}\frac{m_n(y)-m_n(x)}{y-x}= \sum_{j=0}^{n-1} x^{n-1}=n x^{n-1}.
\end{align*}
Thus $m_n$ is differentiable at $x$ and $m_n'(x)=n x^{n-1}$. Since $x \in \mathbb{R}$ was arbitrary, $m_n$ is differentiable on $\mathbb{R}$. [Differentiability implies continuity](/theorems/184) at every point, so $m_n$ is continuous on $\mathbb{R}$.
[guided]
For each $n \in \mathbb{N} \cup \{0\}$, define the monomial function $m_n: \mathbb{R} \to \mathbb{R}$ by
\begin{align*}
m_n(x)=x^n.
\end{align*}
The case $n=0$ is the constant function case: $m_0(x)=1$ for every $x \in \mathbb{R}$. Its difference quotient is $0$ at every point, so $m_0$ is differentiable on $\mathbb{R}$ and $m_0'(x)=0$ for every $x \in \mathbb{R}$. It is also continuous on $\mathbb{R}$.
Now let $n \in \mathbb{N}$ and fix $x \in \mathbb{R}$. We compute the derivative from the definition. For $y \ne x$, the finite factorisation
\begin{align*}
y^n-x^n=(y-x)\sum_{j=0}^{n-1} y^{n-1-j}x^j
\end{align*}
gives
\begin{align*}
\frac{m_n(y)-m_n(x)}{y-x}=\sum_{j=0}^{n-1} y^{n-1-j}x^j.
\end{align*}
This is the key point: after cancellation, the quotient has no singular denominator, so it has an ordinary limit as $y \to x$. For each fixed index $j \in \{0,\dots,n-1\}$, the factor $x^j$ is constant with respect to $y$, and $y^{n-1-j} \to x^{n-1-j}$ as $y \to x$. Therefore
\begin{align*}
y^{n-1-j}x^j \to x^{n-1-j}x^j=x^{n-1}
\end{align*}
as $y \to x$. Passing the limit through the finite sum gives
\begin{align*}
\lim_{y \to x}\frac{m_n(y)-m_n(x)}{y-x}= \sum_{j=0}^{n-1} x^{n-1}=n x^{n-1}.
\end{align*}
Hence $m_n$ is differentiable at the arbitrary point $x$, with derivative $m_n'(x)=n x^{n-1}$. Since the point $x$ was arbitrary, $m_n$ is differentiable on all of $\mathbb{R}$. Every differentiable real-valued function is continuous at the point of differentiability, so $m_n$ is continuous on $\mathbb{R}$.
[/guided]
[/step]
[step:Differentiate the polynomial by passing limits through the finite sum]
Fix $x \in \mathbb{R}$. For $y \ne x$, the difference quotient of $p$ at $x$ is
\begin{align*}
\frac{p(y)-p(x)}{y-x}=\sum_{i=0}^{d} a_i \frac{y^i-x^i}{y-x}.
\end{align*}
The sum is finite, so the limit as $y \to x$ may be taken term by term. Using the monomial derivative formula from the previous step, we obtain
\begin{align*}
p'(x)=\sum_{i=0}^{d} a_i m_i'(x).
\end{align*}
Since $m_0'(x)=0$ and $m_i'(x)=i x^{i-1}$ for $i \ge 1$, this becomes
\begin{align*}
p'(x)=\sum_{i=1}^{d} i a_i x^{i-1}.
\end{align*}
Thus $p$ is differentiable at $x$. Since $x \in \mathbb{R}$ was arbitrary, $p$ is differentiable on $\mathbb{R}$ with the stated derivative formula. Because each $m_i$ is continuous and $p$ is a finite linear combination of the functions $m_i$, the function $p$ is continuous on $\mathbb{R}$.
[/step]
[step:Differentiate the proposed antiderivative term by term]
The function $P: \mathbb{R} \to \mathbb{R}$ is the finite linear combination
\begin{align*}
P(x)=\sum_{i=0}^{d} \frac{a_i}{i+1}m_{i+1}(x).
\end{align*}
Using the same termwise differentiation argument and the monomial derivative formula, for every $x \in \mathbb{R}$ we have
\begin{align*}
P'(x)=\sum_{i=0}^{d} \frac{a_i}{i+1}(i+1)x^i.
\end{align*}
Simplifying each coefficient gives
\begin{align*}
P'(x)=\sum_{i=0}^{d} a_i x^i.
\end{align*}
By the definition of $p$, this says $P'(x)=p(x)$ for every $x \in \mathbb{R}$. Therefore $P'=p$, completing the proof.
[/step]