23. (1) Find the range of positive real numbers $\lambda$ such that the inequality $\left(\frac{a}{a+\lambda b}\right)^{2}+\left(\frac{b}{b+\lambda a}\right)^{2} \geqslant \frac{2}{(1+\lambda)^{2}}$ holds for any positive real numbers $a$ and $b$;
(2) Find the range of positive real numbers $\lambda$ such that the inequality $\left(\frac{a}{a+\lambda b}\right)^{2}+\left(\frac{b}{b+\lambda a}\right)^{2} \leqslant \frac{2}{(1+\lambda)^{2}}$ holds for any positive real numbers $a$ and $b$.
23. (1) Let $x_{1}=\frac{b}{a}, x_{2}=\frac{a}{b}$, then $x_{1}, x_{2}>0$, and $x_{1} x_{2}=1$. Therefore, equation (1) is equivalent to
$$
\begin{array}{l}
\frac{1}{\left(1+\lambda x_{1}\right)^{2}}+\frac{1}{\left(1+\lambda x_{2}\right)^{2}} \geqslant \frac{2}{(1+\lambda)^{2}} \\
\Leftrightarrow(1+\lambda)^{2}\left[\left(1+\lambda x_{2}\right)^{2}+\left(1+\lambda x_{1}\right)^{2}\right] \geqslant 2\left(1+\lambda x_{2}\right)^{2}\left(1+\lambda x_{1}\right)^{2} \\
\Leftrightarrow(1+\lambda)^{2}\left[2+2 \lambda\left(x_{1}+x_{2}\right)+\lambda^{2}\left(x_{1}^{2}+x_{2}^{2}\right)\right] \geqslant 2\left[1+2\left(\lambda+\lambda^{3}\right)\left(x_{1}+x_{2}\right)+\lambda^{2}\left(x_{1}^{2}+x_{2}^{2}\right)+4 \lambda^{2}+\lambda^{4}\right] \\
\Leftrightarrow M=4 \lambda-6 \lambda^{2}-2 \lambda^{4}+\left(-2 \lambda^{3}+4 \lambda^{2}-2 \lambda\right) \cdot\left(x_{1}+x_{2}\right)+\left(\lambda^{4}+2 \lambda^{3}-\lambda^{2}\right)\left(x_{1}^{2}+x_{2}^{2}\right) \geqslant 0 .
\end{array}
$$

Let $t=x_{1}+x_{2} \geqslant 2 \sqrt{x_{1} x_{2}}=2$, then $x_{1}^{2}+x_{2}^{2}=t^{2}-2$.
$$
\begin{aligned}
M & =4 \lambda-6 \lambda^{2}-2 \lambda^{4}+\left(-2 \lambda^{3}+4 \lambda^{2}-2 \lambda\right) t+\left(\lambda^{4}+2 \lambda^{3}-\lambda^{2}\right)\left(t^{2}-2\right) \\
& =\left(\lambda^{4}+2 \lambda^{3}-\lambda^{2}\right) t^{2}-2 \lambda(\lambda-1)^{2} t-4 \lambda^{4}-4 \lambda^{3}-4 \lambda^{2}+4 \lambda \\
& =\lambda\left[\left(\lambda^{3}+2 \lambda^{2}-\lambda\right) t+2\left(\lambda^{3}+\lambda^{2}+\lambda-1\right)\right](t-2) .
\end{aligned}
$$

Let $f(t)=\left(\lambda^{3}+2 \lambda^{2}-\lambda\right) t+2\left(\lambda^{3}+\lambda^{2}+\lambda-1\right)$
$$
\begin{array}{l}
=\left(\lambda^{3}+2 \lambda^{2}-\lambda\right)(t-2)+2\left(2 \lambda^{3}+3 \lambda^{2}-1\right) \\
=\lambda\left(\lambda^{2}+2 \lambda-1\right)(t-2)+2(2 \lambda-1)(\lambda+1)^{2} .
\end{array}
$$

Given $\lambda>0, t \geqslant 2$, we can conclude that the necessary and sufficient condition for inequality (1) to hold is $f(t) \geqslant 0$.
If $\lambda^{2}+2 \lambda-1 \leqslant 0$, the two real roots of the equation $\lambda^{2}+2 \lambda-1=0$ are $-\sqrt{2}-1$ and $\sqrt{2}-1$. It is easy to see that, in this case, $0<\lambda \leqslant \sqrt{2}-1$.
If $\lambda \geqslant \frac{1}{2}$, i.e., $2 \lambda-1 \geqslant 0$, then $f(t)>0$, and inequality (1) holds.
If $\sqrt{2}-1<\lambda<\frac{1}{2}$, since $2(2 \lambda-1)(\lambda+1)^{2}<0$, for a fixed $\lambda$, there always exists a sufficiently small $|t-2|$ such that $f(t)<0$. Therefore, $\lambda \geqslant \frac{1}{2}$ is the necessary and sufficient condition for inequality (1) to hold.
(2) If we replace the “ $\geqslant$ ” sign with “ $\leqslant$ ” in the above discussion, it is easy to conclude that the necessary and sufficient condition for inequality (2) to hold is $0<\lambda \leqslant \sqrt{2}-1$.