Example 12 Let $n$ be a fixed integer, $n \geqslant 2$.
(1) Determine the smallest constant $c$ such that the inequality
$$
\sum_{1 \leqslant i<j \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 to hold.
(IMO - 40 Problem)
(1) When non-negative real numbers $x_{1}, x_{2}, \cdots, x_{n}$ are not all 0, let
$$
x=\frac{\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}}{\left(\sum_{i=1}^{n} x_{i}\right)^{2}}, y=\frac{\sum_{1 \leqslant i<j \leq k \leqslant n} x_{i} x_{j} x_{k}\left(x_{i}+x_{j}+x_{k}\right)}{\left(\sum_{i=1}^{n} x_{i}\right)^{4}} .
$$

Since $\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\left(x_{i}^{2}+x_{j}^{2}\right)$
$$
\begin{array}{l}
=\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}-\sum_{(k=1, j, 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 i<j \leqslant n} x_{i} x_{j}\right)^{2}-\sum_{1 \leqslant i<j<k \leqslant n} x_{i} x_{j} x_{k}\left(x_{i}+x_{j}+x_{k}\right),
\end{array}
$$

Thus ( *) $\Leftrightarrow c \geqslant-2 x^{2}+x-y$.
$$
\text { Also, }-2 x^{2}+x-y=-2\left(x-\frac{1}{4}\right)^{2}+\frac{1}{8}-y \leqslant \frac{1}{8} \text {, }
$$

The equality holds if and only if $x=\frac{1}{4}$ and $y=0$,
Therefore, $c \geqslant \frac{1}{8}, c_{\text {min }}=\frac{1}{8}$, which also holds when $x_{1}=x_{2}=\cdots=x_{n}=0$.
(2) When $c=\frac{1}{8}$, the necessary and sufficient condition for $x=\frac{1}{4}$ and $y=0$ is
$$
\begin{array}{l}
\left(\sum_{i=1}^{n} x_{i}\right)^{2}=4 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j} \text {, 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} \text {, and } \sum_{1 \leqslant i<j<k \leqslant n} x_{i} x_{j} x_{k}=0 \text {. } \\
\end{array}
$$

Also, $\sum_{1 \leqslant i<j<k \leqslant n} x_{i} x_{j} x_{k}=0 \Leftrightarrow x_{1}, x_{2}, \cdots, x_{n}$ have at most two non-zero terms $x_{i} 、 x_{j}$, and at this time $\sum_{i=1}^{n} x_{i}^{2}=2 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j} \Leftrightarrow x_{i}^{2}+x_{j}^{2}+2 x_{i} x_{j} \Leftrightarrow x_{i}=x_{j}$.

Therefore, the necessary and sufficient condition for $x=\frac{1}{4}$ and $y=0$ is that $x_{1}, x_{2}, \cdots, x_{n}$ have two equal terms (which can be 0), and the rest are all 0.