Example 1 Let $x_{1}, x_{2}, \cdots, x_{n} \geqslant 0$ and $\sum_{i=1}^{n} x_{i} \geqslant k$, where $k(k \geqslant 1)$ is a positive constant. Find
$$
f\left(x_{1}, x_{2}, \cdots, x_{n}\right)=\frac{x_{1} \sqrt{\sum_{i=1}^{n} x_{i}}}{\left(\sum_{i=1}^{n-1} x_{i}\right)^{2}+x_{n}}
$$

the maximum value.
Let $a=x_{1}, b=\sum_{i=2}^{n-1} x_{i}, c=x_{n}$, then $a, b, c \geqslant 0, a+b+c \geqslant k$. Up to this point, the original function is reduced from $n$ variables to three variables, i.e.,
$$
\begin{array}{l}
f\left(x_{1}, x_{2}, \cdots, x_{n}\right) \\
=\frac{a \sqrt{a+b+c}}{(a+b)^{2}+c}=g(a, b, c) .
\end{array}
$$

Let $s=a+b+c$, then $s \geqslant k$. Thus,
$$
\begin{array}{l}
g(a, b, c)=\frac{a \sqrt{s}}{(s-c)^{2}+c} \\
\leqslant \frac{(s-c) \sqrt{s}}{(s-c)^{2}+c}=\frac{\sqrt{s}}{(s-c)+\frac{c}{s-c}} .
\end{array}
$$

Notice that
$$
\begin{array}{l}
(s-c)+\frac{c}{s-c} \geqslant 2 \sqrt{s}-1 \\
\Leftrightarrow(c-s+\sqrt{s})^{2} \geqslant 0,
\end{array}
$$

Therefore, $g(a, b, c) \leqslant \frac{\sqrt{s}}{2 \sqrt{s}-1}=\frac{1}{2-\frac{1}{\sqrt{s}}}$
$$
\leqslant \frac{1}{2-\frac{1}{\sqrt{k}}}=\frac{\sqrt{k}}{2 \sqrt{k}-1} \text {. }
$$

When $b=0, c=k-\sqrt{k}, a=\sqrt{k}$, i.e.,
$$
x_{1}=\sqrt{k}, x_{i}=0(i=2,3, \cdots, n-1), x_{n}=k-\sqrt{k}
$$

the equality holds.
Therefore, the maximum value of $f\left(x_{1}, x_{2}, \cdots, x_{n}\right)$ is
$$
\frac{\sqrt{k}}{2 \sqrt{k}-1} \text {. }
$$