7. (40th IMO Problem) 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\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.
7. Since the inequality is homogeneous and symmetric, we may assume without loss of generality that $x_{1} \geqslant x_{2} \geqslant \cdots \geqslant x_{n} \geqslant 0$, and $\sum_{i=1}^{n} x_{i}=1$. Therefore, we only need to find the maximum value of $F\left(x_{1}, x_{2}, \cdots, x_{n}\right)=\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\left(x_{i}^{2}+x_{j}^{2}\right)$. Let the last non-zero number among $x_{1}, x_{2}, \cdots, x_{n}$ be $x_{k+1}(k \geqslant 2)$. Adjust $x=\left(x_{1}, x_{2}, \cdots, x_{k}, x_{k+1}, 0, \cdots, 0\right)$ to $x^{\prime}=\left(x_{1}, x_{2}, \cdots, x_{k-1}, x_{k}+x_{k+1}, 0,0, \cdots, 0\right)$. Then, $F\left(x^{\prime}\right)-F(x)=$ $\sum_{i=1}^{k-1} x_{i}\left(x_{k}+x_{k+1}\right)\left[x_{i}^{2}+\left(x_{k}+x_{k+1}\right)^{2}\right]-\sum_{i=1}^{k-1} x_{i} x_{k}\left(x_{i}^{2}+x_{k}^{2}\right)-\sum_{i=1}^{k-1} x_{i} x_{k+1}\left(x_{i}^{2}+x_{k+1}^{2}\right)=x_{k} x_{k+1} \cdot$ $\left[3\left(x_{k}+x_{k+1}\right)\left(1-x_{k}-x_{k+1}\right)-x_{k}^{2}-x_{k+1}^{2}\right]=x_{k} x_{k+1}\left\{\left(x_{k}+x_{k+1}\right)\left[3-4\left(x_{k}+x_{k+1}\right)\right]+2 x_{k} x_{k+1}\right\}$. Since $1 \geqslant x_{1}+x_{k}+x_{k+1} \geqslant \frac{1}{2}\left(x_{k}+x_{k+1}\right)+x_{k}+x_{k+1}=\frac{3}{2}\left(x_{k}+x_{k+1}\right)$, we have $x_{k}+x_{k+1} \leqslant \frac{2}{3}<\frac{3}{4}$, thus $F\left(x^{\prime}\right)-F(x) \geqslant 0$. Therefore, when adjusting $x$ to $x^{\prime}$, the function strictly increases. Hence, after a finite number of adjustments, we get $F(x) \leqslant F(a, b, 0,0, \cdots, 0)=a b\left(a^{2}+b^{2}\right)=\frac{1}{2}(2 a b)(1-2 a b) \leqslant \frac{1}{2}\left[\frac{2 a b+(1-2 a b)}{2}\right]^{2} \leqslant \frac{1}{8}$. On the other hand, we have $F\left(\frac{1}{2}, \frac{1}{2}, 0, \cdots, 0\right)=\frac{1}{8}$, so the maximum value of $F\left(x_{1}, \cdots, x_{n}\right)$ is $\frac{1}{8}$, and the constant $c=\frac{1}{8}$. The equality holds when $x_{1}, x_{2}, \cdots, x_{n}$ have $n-2$ zeros, and the other two are equal (these two can also be zero).