Example 1 Let the function $f(x)$ satisfy
$$
f\left(\frac{1}{1-x}\right)=x f(x)+1 \text {. }
$$

Then $f(5)=$ ( ).
(A) $\frac{1}{2}$
(B) $\frac{4}{5}$
(C) $\frac{8}{5}$
(D) $\frac{9}{5}$
Let $x=5,-\frac{1}{4}, \frac{4}{5}$, we get respectively
$$
\begin{array}{l}
f\left(-\frac{1}{4}\right)=5 f(5)+1 \\
f\left(\frac{4}{5}\right)=-\frac{1}{4} f\left(-\frac{1}{4}\right)+1 \\
f(5)=\frac{4}{5} f\left(\frac{4}{5}\right)+1
\end{array}
$$

Substituting equations (2) and (1) into equation (3) in sequence, we get
$$
\begin{array}{l}
f(5)=\frac{4}{5}\left(-\frac{1}{4} f\left(-\frac{1}{4}\right)+1\right)+1 \\
=-\frac{1}{5} f\left(-\frac{1}{4}\right)+\frac{9}{5} \\
=-\frac{1}{5}(5 f(5)+1)+\frac{9}{5} \\
=-f(5)+\frac{8}{5} .
\end{array}
$$

Therefore, $f(5)=\frac{4}{5}$.