9. (14 points) Let positive real numbers $x, y, z$ satisfy $xyz=1$. Try to find the maximum value of $f(x, y, z)=(1-yz+z)(1-xz+x)(1-xy+y)$ and the values of $x, y, z$ at that time.
9. Solution: Since $\left\{\begin{array}{l}1-y z+z<0 \\ 1-x z+x<0\end{array} \Leftrightarrow\left\{\begin{array}{l}x+x z<1 \\ y+x y<1\end{array} \Rightarrow(x+\right.\right.$ $x z)(y+x y)<1 \Leftrightarrow x+x y+x^{2} y<0$ contradiction.

Therefore, $1-y z+z, 1-x z+x, 1-x y+y$ can have at most one negative value. Without loss of generality, assume all three expressions are positive,
since $(1-y z+z)(1-x z+x)(1-x y+y)=(x-$
$$
\begin{aligned}
x y z & +x z)(y-x y z+x y)(z-x y z+y z) \\
& =(x-1+x z)(y-1+x y)(z-1+y z),
\end{aligned}
$$

so $f^{2}(x, y, z)=[(1-y z+z)(1-x z+x)(1$
$$
\begin{array}{l}
-x y+y)]^{2} \\
\quad=[(1-y z+z)(1-x z+x)(1-x y+y)][(x- \\
1+x z)(y-1+x y)(z-1+y z)] \\
\quad=\left[z^{2}-(1-y z)^{2}\right]\left[x^{2}-(1-x z)^{2}\right]\left[y^{2}-(1-\right.
\end{array}
$$
$\left.x y)^{2}\right] \leqslant(x y z)^{2}=1$, where “ $=$ ” holds only when $x=y=z=1$, so the maximum value of $f(x, y, z)$ is $1$.