Example 5 The sequence of real numbers $a_{1}, a_{2}, \cdots, a_{n}(n \geqslant 3)$ satisfies
$$
a_{1}+a_{2}+\cdots+a_{n}=0 \text {, }
$$

and $2 a_{k} \leqslant a_{k-1}+a_{k+1}(k=2,3, \cdots, n-1)$.
Find the smallest $\lambda(n)$, such that for all $k \in\{1$, $2, \cdots, n\}$, we have
$$
\left|a_{k}\right| \leqslant \lambda(n) \max \left\{\left|a_{1}\right|,\left|a_{n}\right|\right\} .
$$
Let $a_{1}=1, a_{2}=-\frac{n+1}{n-1}$,
$$
a_{k}=-\frac{n+1}{n-1}+\frac{2 n(k-2)}{(n-1)(n-2)}(k=3,4, \cdots, n),
$$

then it satisfies $a_{1}+a_{2}+\cdots+a_{n}=0$, and
$$
2 a_{k} \leqslant a_{k-1}+a_{k+1} \text {. }
$$

At this point, $\lambda(n) \geqslant \frac{n+1}{n-1}$.
Next, we prove:
When $\lambda(n)=\frac{n+1}{n-1}$, for $k \in\{1,2, \cdots, n\}$,
we have
$$
\left|a_{k}\right| \leqslant \lambda(n) \max \left\{\left|a_{1}\right|,\left|a_{n}\right|\right\} .
$$

By property 1, we get
$$
a_{n}-a_{n-1} \geqslant a_{n-1}-a_{n-2} \geqslant \cdots \geqslant a_{2}-a_{1} \text {. }
$$
$$
\text { Hence }(k-1)\left(a_{n}-a_{1}\right)
$$
$$
\begin{array}{l}
=(k-1) \sum_{i=2}^{n}\left(a_{i}-a_{i-1}\right) \\
\geqslant(n-1) \sum_{i=2}^{k}\left(a_{i}-a_{i-1}\right) \\
=(n-1)\left(a_{k}-a_{1}\right) .
\end{array}
$$

Then $a_{k} \leqslant a_{1}+\frac{k-1}{n-1}\left(a_{n}-a_{1}\right)$
$$
=\frac{1}{n-1}\left[(n-k) a_{1}+(k-1) a_{n}\right] \text {. }
$$

For a fixed $k(k \neq 1, n)$, when $1 \leqslant j \leqslant k$, by property 3, we get
$$
a_{j} \leqslant \frac{1}{k-1}\left[(k-j) a_{1}+(j-1) a_{k}\right] ;
$$

When $k \leqslant j \leqslant n$, similarly by property 3, we get
$$
\begin{array}{l}
a_{j} \leqslant \frac{1}{n-k}\left[(n-j) a_{k}+(j-k) a_{n}\right] . \\
\text { Hence } \sum_{j=1}^{k} a_{j} \leqslant \frac{1}{k-1} \sum_{j=1}^{k}\left[(k-j) a_{1}+(j-1) a_{k}\right] \\
=\frac{k}{2}\left(a_{1}+a_{k}\right), \\
\sum_{j=k}^{n} a_{j} \leqslant \frac{1}{n-k} \sum_{j=k}^{n}\left[(n-j) a_{k}+(j-k) a_{n}\right] \\
=\frac{n+1-k}{2}\left(a_{k}+a_{n}\right) .
\end{array}
$$

Adding the above two inequalities, we get
$$
\begin{array}{l}
a_{k}=\sum_{j=1}^{k} a_{j}+\sum_{j=k}^{n} a_{j} \\
\leqslant \frac{k}{2}\left(a_{1}+a_{k}\right)+\frac{n+1-k}{2}\left(a_{k}+a_{n}\right) \\
=\frac{k}{2} a_{1}+\frac{n+1}{2} a_{k}+\frac{n+1-k}{2} a_{n} .
\end{array}
$$

Then $a_{k} \geqslant-\frac{1}{n-1}\left[k a_{1}+(n+1-k) a_{n}\right]$.
From equations (1) and (2), we get
$$
\begin{array}{l}
\left|a_{k}\right| \leqslant \frac{1}{n-1} \max \left\{\left|(n-k) a_{1}+(k-1) a_{n}\right|,\right. \\
\left.\left|k a_{1}+(n+1-k) a_{n}\right|\right\} \\
\leqslant \frac{n+1}{n-1} \max \left\{\left|a_{1}\right|,\left|a_{n}\right|\right\}(k=1,2, \cdots, n-1) .
\end{array}
$$

In summary, $\lambda(n)_{\min }=\frac{n+1}{n-1}$.