[proofplan]
We construct an auxiliary function $g$ that vanishes at $n+2$ distinct points (the $n+1$ interpolation nodes plus $x$), then apply Rolle's theorem repeatedly to find a zero of $g^{(n+1)}$. Evaluating $g^{(n+1)}$ using the facts that $p_n^{(n+1)} = 0$ (since $\deg p_n \le n$) and $\omega^{(n+1)} = (n+1)!$ (since $\omega$ is monic of degree $n+1$) yields the error formula.
[/proofplan]
[step:Reduce to the case $x \notin \{x_0, \dots, x_n\}$]
If $x = x_j$ for some $j$, both sides of the error formula vanish ($f(x_j) - p_n(x_j) = 0$ and $\prod_{i=0}^n(x_j - x_i) = 0$), so any $\xi_x \in (a,b)$ works.
Assume henceforth that $x \notin \{x_0, \dots, x_n\}$.
[/step]
[step:Construct an auxiliary function $g$ with $n+2$ zeros]
Define the nodal polynomial $\omega(t) = \prod_{i=0}^n(t - x_i)$ and the auxiliary function
\begin{align*}
g(t) &= f(t) - p_n(t) - \frac{f(x) - p_n(x)}{\omega(x)}\,\omega(t).
\end{align*}
Then $g \in C^{n+1}[a,b]$, and $g$ vanishes at the $n+2$ distinct points $x_0, x_1, \dots, x_n, x$:
at each $x_i$, $f(x_i) - p_n(x_i) = 0$ and $\omega(x_i) = 0$;
at $x$, the construction forces $g(x) = f(x) - p_n(x) - \frac{f(x) - p_n(x)}{\omega(x)}\omega(x) = 0$.
[/step]
[step:Apply Rolle's theorem repeatedly to locate a zero of $g^{(n+1)}$]
By Rolle's theorem applied repeatedly: $g$ has $n+2$ zeros, so $g'$ has at least $n+1$ zeros (one between each consecutive pair), $g''$ has at least $n$ zeros, and continuing, $g^{(n+1)}$ has at least one zero $\xi_x \in (a,b)$.
[/step]
[step:Evaluate $g^{(n+1)}(\xi_x)$ to derive the error formula]
Since $p_n$ has degree $\le n$, $p_n^{(n+1)} = 0$.
Since $\omega$ is monic of degree $n+1$, $\omega^{(n+1)} = (n+1)!$.
Therefore
\begin{align*}
0 = g^{(n+1)}(\xi_x) &= f^{(n+1)}(\xi_x) - 0 - \frac{f(x) - p_n(x)}{\omega(x)} \cdot (n+1)!.
\end{align*}
Solving for $f(x) - p_n(x)$:
\begin{align*}
f(x) - p_n(x) &= \frac{1}{(n+1)!}\,f^{(n+1)}(\xi_x)\,\omega(x) = \frac{1}{(n+1)!}\,f^{(n+1)}(\xi_x)\prod_{i=0}^n(x - x_i).
\end{align*}
[/step]