Example 8 Try to find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$. such that for any $x, y \in \mathbf{R}$ we have
$$
f(x f(y))=f\left(x y^{2}\right)-2 x^{2} f(y)-f(x)-1
$$
Let $x=0$, then $f(0)=-1$  
Let $y=0$, then $f(x)+f(-x)=2x^2-2$  
In equation *, replace $x$ with $-x$, we get $f(-x f(y))=f\left(-x y^2\right)-2 x^2 f(y)-f(-x)-1$  
Add * and ** together, and use equation (2) $2x^2 f^2(y)-2=2x^2 y^4-2-4x^2 f(y)-2x^2+2-2$ $x^2 f^2(y)=x^2 y^4-2x^2 f(y)-x^2$. Therefore, $f^2(y)=y^4-2f(y)-1$  
That is, $(f(y)+1)^2=y^4$. So $|f(y)+1|=y^2$  
Assume there exists a $y_1 \neq 0$ such that $f(y_1)+1=-y_1^2$, i.e., $f(y_1)=-y_1^2-1$, substituting into (2) we have,  
$$
f(-y_1)=2y_1^2-2-f(y_1)=3y_1^2-1
$$  

Substitute into (3), $|3y_1^2-1+1|=(-y_1)^2, 3y_1^2=y_1^2, y_1=0$ which contradicts $y_1 \neq 0$!  
Therefore, $f(y)+1=y^2, f(y)=y^2-1$, and it satisfies the original equation upon verification.