8. Let the function $f: \mathbf{R} \rightarrow \mathbf{R}$, satisfy $f(0)=1$, and for any $x, y \in \mathbf{R}$, there is $f(x y+1)=$ $f(x) f(y)-f(y)-x+2$, then $f(x)=$ $\qquad$
$$
\begin{array}{l}
\text { Let } x=0, y=0 \Rightarrow f(1)=f^{2}(0)-f(0)-0+2=2 \text {; Let } x=1, y=-1 \\
\Rightarrow f(0)=f(1) f(-1)-f(-1)-1+2=f(-1)+1 \Rightarrow f(-1)=0 .
\end{array}
$$

Then let $y=-1 \Rightarrow f(-x+1)=f(x) f(-1)-f(-1)-x+2=-x+2$ $\Rightarrow f(x)=x+1$. At this point, $f(x) f(y)-f(y)-x+2=(x+1)(y+1)-y-1-x+2$ $=x y+2=f(x y+1)$, which satisfies the condition. Therefore, $f(x)=x+1$.