Example 4 (Problem from the American Mathematical Monthly) Let $x, y, z \in(0, 1)$, and $x^{2}+y^{2}+z^{2}=1$. Find the range of the function $f=x+y+z-xyz$.
On the one hand, from the known conditions, we have $x, y, z \in (0,1)$, $y > y^2$, $z > z^2$, and $x^2 + y^2 = 1 - z^2$.

Thus, $f = x + y + z - xyz$
$\geq x + y + z - x \cdot \frac{y^2 + z^2}{2}$
$= x + y + z - x \cdot \frac{1 - x^2}{2}$
$= y + z + x \cdot \frac{1 + x^2}{2}$
$\geq y + z + x \cdot \frac{2x}{2}$
$> y^2 + z^2 + x^2 = 1$,
which means $x + y + z - xyz > 1$.
On the other hand, by the pigeonhole principle and $x^2 + y^2 + z^2 = 1$, we know that among the three positive real numbers $x, y, z$, there must be two that are not greater than or not less than $\frac{\sqrt{3}}{3}$. Without loss of generality, assume they are $x$ and $y$, so we have $\left(x - \frac{\sqrt{3}}{3}\right) \cdot \left(y - \frac{\sqrt{3}}{3}\right) \geq 0$, which means $xy + \frac{1}{3} \geq \frac{\sqrt{3}}{3}(x + y)$, thus
$$\sqrt{3}xyz + \frac{\sqrt{3}}{3}z \geq xz + yz$$

Also, since $xy \leq \frac{x^2 + y^2}{2} = \frac{1 - z^2}{2} = \frac{\frac{4}{3} - \left(\frac{1}{3} + z^2\right)}{2} \leq \frac{\frac{4}{3} - 2\sqrt{\frac{1}{3}z^2}}{2} = \frac{2}{3} - \frac{\sqrt{3}}{3}z$

which means $\frac{2}{3} - \frac{\sqrt{3}}{3}z \geq xy$
From (2) and (3), we get $xy + yz + zx \leq \frac{2}{3} + \sqrt{3}xyz$
Also, from $(x + y + z - \sqrt{3})^2 \geq 0$ and $x^2 + y^2 + z^2 = 1$, we get
$xy + yz + zx \geq \sqrt{3}(x + y + z) - 2$
Combining (4) and (5), we get $x + y + z - xyz \leq \frac{8\sqrt{3}}{9}$
In summary, the range of the function $f = x + y + z - xyz$ is: $\left(1, \frac{8\sqrt{3}}{9}\right]$