1. Given $f(\sin x-1) \geqslant \cos ^{2} x+2$, find $f(x)$.

Translate the text above into English, please retain the original text's line breaks and format, and output the translation result directly.
1. Let $y=\sin x-1$, then $-2 \leqslant y \leqslant 0, \sin x=1+y$, so $\cos ^{2} x=1-\sin ^{2} x=1-(y+1)^{2}$. Therefore, $f(y) \geqslant$ $1-(y+1)^{2}+2=-y^{2}-2 y+2$, hence the solution to the given inequality is
$$
f(x) \geqslant-x^{2}-2 x+2 \cdot(-2 \leqslant x \leqslant 0) .
$$

Upon checking, $f(x) \geqslant-x^{2}-2 x+2(-2 \leqslant x \leqslant 0)$ is the solution to the inequality.