Find the functions $f: \mathbb{Q} \rightarrow \mathbb{Q}$ such that

$$
\forall x, y \in \mathbb{Q}, f(1)=2 \text { and } f(x y)=f(x) f(y)-f(x+y)+1
$$
By setting $y=1$, we find that $f(x+1)=f(x)+1$. A small induction then gives $f(x+n)=f(x)+n$. And since $f(1)=2$, we already have the values on the integers: $\forall n \in \mathbb{Z}, f(n)=n+1$.

Now let's find the images of the rationals: let $\frac{p}{q} \in \mathbb{Q}$. By setting $x=\frac{p}{q}$ and $y=q$, we see:

$$
\begin{aligned}
f(p) & =f\left(\frac{p}{q}\right) f(q)-f\left(\frac{p}{q}+q\right)+1 \\
p+1 & =(q+1) f\left(\frac{p}{q}\right)-f\left(\frac{p}{q}\right)-q+1 \\
f\left(\frac{p}{q}\right) & =\frac{p}{q}+1
\end{aligned}
$$

Therefore, the only possible solution is $f(x)=x+1$. It is easy to verify that this function satisfies the functional equation.