[step:Prove that no other polynomial of degree at most $n$ has the same interpolation values]
We first record the elementary root-count fact needed for uniqueness.
[claim:A nonzero polynomial of degree at most $m$ has at most $m$ distinct real roots]
Let $m \in \mathbb{Z}_{\ge 0}$. If $r \in \mathbb{R}[t]$ is nonzero and $\deg r \le m$, then $r$ has at most $m$ distinct real roots.
[/claim]
[proof]
We use induction on $m$. For $m=0$, a nonzero polynomial of degree at most $0$ is a nonzero constant, so it has no real roots.
Assume the statement holds for $m-1$, where $m \ge 1$, and let $r \in \mathbb{R}[t]$ be nonzero with $\deg r \le m$. If $r$ has no real root, the conclusion holds. Otherwise choose a real root $a \in \mathbb{R}$ of $r$. Write
\begin{align*}
r(t)=\sum_{q=0}^{m} c_q t^q
\end{align*}
with coefficients $c_0,\dots,c_m \in \mathbb{R}$, allowing $c_q=0$ for indices above the actual degree. Since $r(a)=0$, we have
\begin{align*}
r(t)=r(t)-r(a)=\sum_{q=1}^{m} c_q(t^q-a^q).
\end{align*}
For each $q \ge 1$,
\begin{align*}
t^q-a^q=(t-a)\sum_{s=0}^{q-1} t^{q-1-s}a^s.
\end{align*}
Thus there exists $s_0 \in \mathbb{R}[t]$ with $\deg s_0 \le m-1$ such that
\begin{align*}
r(t)=(t-a)s_0(t).
\end{align*}
Because $r$ is nonzero, $s_0$ is nonzero. Every root $b \ne a$ of $r$ satisfies $(b-a)s_0(b)=0$, and since $b-a \ne 0$, it follows that $s_0(b)=0$. By the induction hypothesis, $s_0$ has at most $m-1$ distinct real roots. Therefore $r$ has at most $1+(m-1)=m$ distinct real roots.
[/proof]
Now let $q \in \mathbb{R}[t]$ be another polynomial of degree at most $n$ such that $q(x_i)=y_i$ for every $i \in \{0,1,\dots,n\}$. Define
\begin{align*}
r:\mathbb{R} &\to \mathbb{R}
\end{align*}
by
\begin{align*}
r(t)=p(t)-q(t).
\end{align*}
Then $r \in \mathbb{R}[t]$ and $\deg r \le n$ unless $r$ is the zero polynomial. For every $i \in \{0,1,\dots,n\}$,
\begin{align*}
r(x_i)=p(x_i)-q(x_i)=y_i-y_i=0.
\end{align*}
Thus $r$ has the $n+1$ distinct roots $x_0,x_1,\dots,x_n$. If $r$ were nonzero, the root-count fact with $m=n$ would imply that $r$ has at most $n$ distinct roots, a contradiction. Hence $r$ is the zero polynomial, so $p=q$. This proves uniqueness and completes the proof of the formula.
[/step]