Example 1 Find the range of the function $y=\frac{x^{2}-x}{x^{2}-x+1}$.
Solve the functional transformation to
$$
(y-1) x^{2}+(1-y) x+y=0
$$

When $y=1$, equation (1) becomes $1=0$, which is obviously not true, so $y=1$ is not in the range of the function:
When $y \neq 1$, since $x \in \mathbf{R}$,
$\therefore \Delta=(1-y)^{2}-4 y(y-1) \geqslant 0$, solving this yields $-\frac{1}{3} \leqslant y<1$.
$\therefore$ The range of the function is $\left[-\frac{1}{3}, 1\right)$.