7. Let the function $f: \mathbf{R} \rightarrow \mathbf{R}$, satisfy $f(0)=1$, and for any $x, y \in \mathbf{R}$ we have
$$
f(x y+1)=f(x) f(y)-f(y)-x+2 .
$$

Then $f(x)=$ $\qquad$
$$
\text { 7. } x+1 \text {. }
$$

For any $x, y \in \mathbf{R}$, we have
$$
\begin{array}{l}
f(x y+1)=f(x) f(y)-f(y)-x+2 \\
\Rightarrow f(x y+1)=f(y) f(x)-f(x)-y+2 . \\
\text { Therefore, } f(x) f(y)-f(y)-x+2 \\
=f(y) f(x)-\dot{f}(x)-y+2,
\end{array}
$$

which means $f(x)+y=f(y)+x$.
Let $y=0$, we get $f(x)=x+1$.