21. (China-Europe) For any given integer $n \geqslant 2$, find the largest $C_{n}$ such that for any positive real numbers $a_{1}, a_{2}, \cdots, a_{n}$, we have
$$\frac{a_{1}^{2}+\cdots+a_{n}^{2}}{n} \geqslant\left(\frac{a_{1}+\cdots+a_{n}}{n}\right)^{2}+C_{n}\left(a_{1}-a_{n}\right)^{2}$$
Proof. Taking $a_{1}=3, a_{2}=\cdots=a_{n-1}=2, a_{n}=1$, it is easy to see that $C_{n} \leqslant \frac{1}{2 n}$. If we can prove that for any positive real numbers $a_{1}, a_{2}, \cdots, a_{n}$, we have
$$\frac{a_{1}^{2}+\cdots+a_{n}^{2}}{n} \geqslant\left(\frac{a_{1}+\cdots+a_{n}}{n}\right)^{2}+\frac{1}{2 n}\left(a_{1}-a_{n}\right)^{2}$$

then the largest $C_{n}=\frac{1}{2 n}$.
Notice the identity
$$\frac{a_{1}^{2}+\cdots+a_{n}^{2}}{n}-\left(\frac{a_{1}+\cdots+a_{n}}{n}\right)^{2}=\frac{\sum_{i<j}\left(a_{i}-a_{j}\right)^{2}}{n^{2}}$$

and
$$\begin{aligned}
\sum_{i<j}\left(a_{i}-a_{j}\right)^{2} & \geqslant\left(a_{1}-a_{2}\right)^{2}+\left(a_{1}-a_{3}\right)^{2}+\cdots+\left(a_{1}-a_{n-1}\right)^{2}+\left(a_{1}-a_{n}\right)^{2} \\
& +\left(a_{2}-a_{n}\right)^{2}+\left(a_{3}-a_{n}\right)^{2}+\cdots+\left(a_{n-1}-a_{n}\right)^{2} \\
& =\sum_{k=2}^{n-1}\left[\left(a_{1}-a_{k}\right)^{2}+\left(a_{k}-a_{n}\right)^{2}\right]+\left(a_{1}-a_{n}\right)^{2} \\
& \geqslant \sum_{k=2}^{n-1} \frac{\left(a_{1}-a_{n}\right)^{2}}{2}+\left(a_{1}-a_{n}\right)^{2}=\frac{n\left(a_{1}-a_{n}\right)^{2}}{2}
\end{aligned}$$

where we use
$$\left(a_{1}-a_{k}\right)^{2}+\left(a_{k}-a_{n}\right)^{2} \geqslant \frac{\left(a_{1}-a_{n}\right)^{2}}{2}$$

which can be obtained by the Cauchy inequality.
Thus, by (10) we have
$$\frac{a_{1}^{2}+\cdots+a_{n}^{2}}{n}-\left(\frac{a_{1}+\cdots+a_{n}}{n}\right)^{2} \geqslant \frac{\left(a_{1}-a_{n}\right)^{2}}{2 n}$$

i.e.,
$$\frac{a_{1}^{2}+\cdots+a_{n}^{2}}{n} \geqslant\left(\frac{a_{1}+\cdots+a_{n}}{n}\right)^{2}+\frac{1}{2 n}\left(a_{1}-a_{n}\right)^{2}$$

Therefore, the largest $C_{n}=\frac{1}{2 n}$.