Example 3 Let $n$ be a fixed integer, $n \geqslant 2$.
(1) Determine the smallest constant $c$ such that the inequality
$$
\sum_{1 \leqslant i \leqslant n} x_{i} x_{j}\left(x_{i}^{2}+x_{j}^{2}\right) \leqslant c \cdot\left(\sum_{i=1}^{n} x_{i}\right)^{4}
$$

holds for all non-negative real numbers $x_{1}, x_{2}, \cdots, x_{n}$;
(2) For this constant $c$, determine the necessary and sufficient conditions for equality.
(40th IMO)
Solution: (1) When non-negative real numbers $x_{1}, x_{2}, \cdots, x_{n}$ are not all 0, let $x=\frac{\sum_{1 \leq 1<j \leqslant n} x_{i} x_{j}}{\left(\sum_{i=1}^{n} x_{i}\right)^{2}}$,
$$
\begin{array}{l}
y=\frac{\sum_{1 \leq 1<j<k \leq n} x_{i} x_{j} x_{k}\left(x_{i}+x_{j}+x_{k}\right)}{\left(\sum_{i=1}^{n} x_{1}\right)^{4}} . \\
\because \sum_{1 \leqslant 1<j \leqslant n} x_{i} x_{j}\left(x_{1}^{2}+x_{j}^{2}\right) \\
=\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\left[\left(\sum_{k=1}^{n} x_{k}\right)^{2}-2 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\right. \\
\left.-\sum_{\substack{k=1 \\
(k \neq 1 . j)}}^{n} x_{k}^{2}\right] \\
=\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\left(\sum_{k=1}^{n} x_{k}\right)^{2}-2\left(\sum_{1 \leqslant 1<j \leqslant n} x_{i} x_{j}\right)^{2} \\
-\sum_{1 \leqslant 1<j<k \leqslant n} x_{i} x_{j} x_{k}\left(x_{i}+x_{j}+x_{k}\right), \\
\therefore \text { Equation (1) } \Leftrightarrow c \geqslant-2 x^{2}+x-y \text {. } \\
\because-2 x^{2}+x-y \\
=-2\left(x-\frac{1}{4}\right)^{2}+\frac{1}{8}-y \leqslant \frac{1}{8}, \\
\end{array}
$$

The equality holds if and only if $x=\frac{1}{4}$ and $y=0$,
$$
\therefore c \geqslant \frac{1}{8}, c_{\operatorname{max}}=\frac{1}{8} \text {, when } x_{1}=x_{2}=\cdots=x_{n}=
$$
0 also satisfies.
(2) When $c=\frac{1}{8}$, the necessary and sufficient condition for $x=\frac{1}{4}$ and $y=0$ is
$$
\left(\sum_{i=1}^{n} x_{i}\right)^{2}=4 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j},
$$

and $\sum_{1 \leqslant i<j<k \leqslant n} x_{i} x_{j} x_{k}\left(x_{i}+x_{j}+x_{k}\right)=0$
$$
\Leftrightarrow \sum_{i=1}^{n} x_{i}^{2}=2 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j},
$$
$\sum_{1 \leqslant 1<1<1 \leq n} x, x_{j} x_{k}=0$.
$$
\because \sum_{1 \leqslant 1<1<1 \leq n} x, x_{j} x_{k}=0
$$
$\Leftrightarrow$ any two of $x_{1}, x_{2}, \cdots, x_{n}$ have a product of 0,
i.e., at most two of $x_{1}, x_{2}, \cdots, x_{n}$ are non-zero, at this time,
$$
\begin{array}{l}
\sum_{i=1}^{n} x_{i}^{2}=2 \sum_{1 \leqslant 1<j \leqslant n} x_{i} x_{j} \Leftrightarrow x_{i}^{2}+x_{j}^{2}=2 x_{i} \\
\Leftrightarrow x_{i}=x_{j} .
\end{array}
$$
$\therefore$ The necessary and sufficient condition for $x=\frac{1}{4}$ and $y=0$ is that two of $x_{1}, x_{2}, \cdots, x_{n}$ are equal (which can be 0), and the rest are all 0.