Example $\mathbf{5}$ Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$, such that for all $a, b \in \mathbf{R}$, we have $f(a f(b))=a b$
Let $a=1$, then $f(f(b))=b$
Obviously, $f$ is surjective (from (1), we know that $f$ can take any value in $\mathbf{R}$). Therefore, there exists at least one $b_{1} \in \mathbf{R}$ such that $f\left(b_{1}\right)=1$. Substitute $b=b_{1}$ into $f(a f(b))=a b$. Then we have $f(a)=b_{1} a$
Substitute (2) into the condition, then $f(a f(b))=b_{1} \cdot a f(b)=b_{1} a \cdot b_{1} b=b_{1}^{2} a b=a b, b_{1}= \pm 1$
Thus, $f(x)=x$ or $-x$
Upon verification, they are both solutions to the original functional equation.