Example 7 Solve the system of equations
$$
\sum_{i=1}^{n} x_{i}^{k}=n \quad (k=1,2, \cdots, n) .
$$
When $n=1$, obviously, $x_{1}=1$.
Assume $n \geqslant 2$, construct the polynomial function
$$
\begin{array}{l}
f(t)=\left(t-x_{1}\right)\left(t-x_{2}\right) \cdots\left(t-x_{n}\right) \\
=t^{n}+a_{1} t^{n-1}+a_{2} t^{n-2}+\cdots+a_{n-1} t+a_{n} .
\end{array}
$$

Then $f\left(x_{1}\right)=f\left(x_{2}\right)=\cdots=f\left(x_{n}\right)=0$.
Also, from the original system of equations, we get
$$
\begin{array}{l}
\sum_{i=1}^{n} f\left(x_{i}\right)=\sum_{i=1}^{n} x_{i}^{n}+\sum_{j=1}^{n-1}\left(a_{j} \sum_{i=1}^{n} x_{i}^{n-j}\right)+a_{n} \sum_{i=1}^{n} 1 \\
=n+a_{1} n+a_{2} n+\cdots+a_{n-1} n+a_{n} n=n f(1) .
\end{array}
$$

By comparison, we get $f(1)=0$. This indicates that one of $x_{1}, x_{2}, \cdots, x_{n}$ is 1, without loss of generality, let $x_{n}=1$, then the remaining unknowns $x_{1}, x_{2}, \cdots, x_{n-1}$ satisfy the system of equations
$$
\sum_{i=1}^{n-1} x_{i}^{k}=n-1(k=1,2, \cdots, n) .
$$

By induction, we can conclude that all $x_{i}=1$.
Thus, the solution to the original system of equations is
$$
x_{1}=x_{2}=\cdots=x_{n}=1 \text {. }
$$