10. (20 points) Try to find the maximum value of the function defined on $(0, \pi)$:
$$
\begin{aligned}
f(x)= & \log _{\sqrt{2}-1}\left[\sqrt{2} \sin \left(x+\frac{\pi}{4}\right)+1\right]+ \\
& \log _{\sqrt{2}+1} \frac{\sin ^{2} x}{2 \sin x-\cos x+1}+ \\
& \cos ^{3} x+\sin ^{2} x-\cos x
\end{aligned}
$$
10. Notice that
$$
\begin{aligned}
f(x)= & \log _{\sqrt{2-1}} \frac{\sin x+\cos x+1}{\sin x} \cdot \frac{2 \sin x-\cos x+1}{\sin x}+ \\
& (1-\cos x) \sin ^{2} x \\
= & \log _{\sqrt{2}-1}\left(1+\cot \frac{x}{2}\right)\left(2+\tan \frac{x}{2}\right)+ \\
& 8 \sin ^{2} \frac{x}{2} \cdot \sin ^{2} \frac{x}{2} \cdot \cos ^{2} \frac{x}{2} \\
= & -\log _{\sqrt{2}+1}\left(3+2 \cot \frac{x}{2}+\tan \frac{x}{2}\right)+ \\
& 4 \sin ^{2} \frac{x}{2} \cdot \sin ^{2} \frac{x}{2} \cdot 2 \cos ^{2} \frac{x}{2} \\
\leqslant & -\log _{\sqrt{2}+1}(3+2 \sqrt{2})+4\left(\frac{2}{3}\right)^{3} \\
= & -2+\frac{32}{27}=-\frac{22}{27} .
\end{aligned}
$$

The equality holds if and only if $\tan \frac{x}{2}=\sqrt{2}$.