Example 6. Solve the inequality
\[
\begin{array}{l}
\sqrt{\frac{\pi}{4}-\operatorname{arctg} \frac{|x|+|y|}{\pi}}+\operatorname{tg}^{2} x+1 \\
\leqslant 2|\operatorname{tg} x|(\sin x+\cos x) .
\end{array}
\]
Solve: Left side $\geqslant \operatorname{tg}^{2} x+1 \geqslant 2|\operatorname{tg} x|$.
Equality holds if and only if $\operatorname{arctg} \frac{|x|+|y|}{\pi}=\frac{\pi}{4}$, and $|\operatorname{tg} x|=1$, i.e., $|x|+|y|=\pi,|\operatorname{tg} x|=1$.
Right side $=2|\operatorname{tg} x| \sin \left(x+\frac{\pi}{4}\right) \leqslant 2|\operatorname{tg} x|$.
Equality holds if and only if $\sin \left(x+\frac{\pi}{4}\right)=1$, i.e., $x=2 k \pi+$ $\frac{\pi}{4}$.

From the above, we can see that the left side $\geqslant 2|\operatorname{tg} x| \geqslant$ right side. However, the given inequality is left side $\leqslant$ right side, thus, the given inequality only holds when equality is achieved. At this point, we have
$$
\left\{\begin{array}{l}
|x|+|y|=\pi, \\
|\operatorname{tg} x|=1, \\
x=2 k \pi+\frac{\pi}{4} .
\end{array}\right.
$$

Considering $|x|<\pi$, we can only have $k=0$, thus we get $x=\frac{\pi}{4}, y= \pm \frac{3}{4} \pi$.