The method of substitution ${ }^{[4]}$ refers to assigning one or several special values to the variables in a functional equation within the domain of the function, thereby achieving the purpose of solving the problem.

Example $\mathbf{3}$ Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for all $x, y \in \mathbf{R}$, we have
$$
f(x y+1)=f(x) f(y)-f(y)-x+2 \text {. }
$$
(2016, Croatian Mathematical Competition)
Let $f(0)=a, f(1)=b$.
Substitute $x=0$ into equation (1) to get
$$
b=(a-1) f(y)+2 \text {. }
$$

When $a \neq 1$, for all $y \in \mathbf{R}$, we have
$$
f(y)=\frac{b-2}{a-1} \text {. }
$$

Substitute the above expression into the original equation, and we find that the constant function is not a solution to the original equation.
Thus, $a=1, b=2$.
Substitute $y=0$ into equation (1) to get
$$
\begin{array}{l}
b=(f(x)-1) a-x+2 \\
\Rightarrow f(x)=x+1 .
\end{array}
$$

Upon verification, $f(x)=x+1$ is the unique solution to the original equation.