3. Given a positive integer $n \geqslant 2$. It is known that non-negative real numbers $a_{1}$, $a_{2}, \cdots, a_{n}$ satisfy $a_{1}+a_{2}+\cdots+a_{n}=1$. Find
$$
a_{1}^{2}+a_{2}^{2}+\cdots+a_{n}^{2}+\sqrt{a_{1} a_{2} \cdots a_{n}}
$$

the maximum value.
(Zhang Lei provided the problem)
3. When $n=2$,
$$
\begin{array}{l}
a_{1}^{2}+a_{2}^{2}+\sqrt{a_{1} a_{2}} \\
=\left(a_{1}+a_{2}\right)^{2}-2 a_{1} a_{2}+\sqrt{a_{1} a_{2}} \\
=1-2 a_{1} a_{2}+\sqrt{a_{1} a_{2}} . \\
\text { Let } \sqrt{a_{1} a_{2}}=t .
\end{array}
$$

Then $a_{1}^{2}+a_{2}^{2}+\sqrt{a_{1} a_{2}}=1-2 t^{2}+t$
$$
=\frac{9}{8}-2\left(t-\frac{1}{4}\right)^{2} \leqslant \frac{9}{8} \text {. }
$$

Let $t=\frac{1}{4}$, i.e., $a_{1,2}=\frac{2 \pm \sqrt{3}}{4}$, then the above expression can achieve the maximum value $\frac{9}{8}$.
When $n=3$, assume $a_{3}$ is the largest.
Thus, $a_{3} \geqslant \frac{1}{3}, a_{3}>\frac{\sqrt{a_{3}}}{2}$.
$$
\begin{array}{l}
\text { Then } \sqrt{a_{1} a_{2} a_{3}}=2 \sqrt{a_{1} a_{2}} \cdot \frac{\sqrt{a_{3}}}{2} \\
\leqslant\left(a_{1}+a_{2}\right) a_{3}=a_{1} a_{3}+a_{2} a_{3} \text {. } \\
\text { Hence } a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+\sqrt{a_{1} a_{2} a_{3}} \\
\leqslant a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{1} a_{3}+a_{2} a_{3} \\
\leqslant\left(a_{1}+a_{2}+a_{3}\right)^{2}=1 .
\end{array}
$$

Thus, $a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+\sqrt{a_{1} a_{2} a_{3}}$

Let $a_{1}=1, a_{2}=a_{3}=0$, then the above expression can achieve the maximum value 1.
When $n \geqslant 4$,
$$
\begin{array}{l}
\sqrt{a_{1} a_{2} \cdots a_{n}} \leqslant \sqrt{a_{1} a_{2} a_{3} a_{4}} \\
\leqslant \frac{1}{2}\left(a_{1} a_{2}+a_{3} a_{4}\right) .
\end{array}
$$
$$
\begin{array}{l}
\text { Then } a_{1}^{2}+a_{2}^{2}+\cdots+a_{n}^{2}+\sqrt{a_{1} a_{2} \cdots a_{n}} \\
\leqslant a_{1}^{2}+a_{2}^{2}+\cdots+a_{n}^{2}+\frac{1}{2}\left(a_{1} a_{2}+a_{3} a_{4}\right) \\
\leqslant\left(a_{1}+a_{2}+\cdots+a_{n}\right)^{2}=1 .
\end{array}
$$

Let $a_{1}=1, a_{2}=a_{3}=\cdots=a_{n}=0$, then the above expression can achieve the maximum value 1.

In summary, when $n=2$, the maximum value is $\frac{9}{8}$; when $n \geqslant 3$, the maximum value is 1.