10. The function $f(x)$ defined on $\mathbf{R}$ satisfies
$$
f\left(f(x)-x^{2}+x\right)=f(x)-x^{2}+x \text {. }
$$

If there is exactly one real number $x_{0}$ such that $f\left(x_{0}\right)=$ $x_{0}$, then $f(x)=$ $\qquad$
10. $x^{2}-x+1$.

Since there is only one real number $x_{0}$ such that $f\left(x_{0}\right) = x_{0}$, it follows that $f(x) - x^{2} + x = x_{0}$ always holds.
Let $x = x_{0}$, we get $f\left(x_{0}\right) - x_{0}^{2} + x_{0} = x_{0}$.
Solving this, we get $x_{0} = 0$ or 1.
When $x_{0} = 0$, $f(x) = x^{2} - x$, in this case, $f(x) = x$ has two solutions, which does not satisfy the condition;

When $x_{0} = 1$, $f(x) = x^{2} - x + 1$, in this case, $f(x) = x$ has only one solution, which satisfies the condition.