I'm new to solving functional equations and found the following functional equation from a collection of functional equations.
Find all functions $f: \mathbb{Q}\to \mathbb{R}$ for $$f(x+y)=f(x)f(y)-f(xy)+1$$ for all $x,y\in \mathbb{Q}$.
By substituting $x,y\to 0$, we get $$f(0)=f(0)^2-f(0)+1$$ $$f(0)^2-2f(0)+1=0$$ $$f(0)=1$$ And then doing the substitution $x\to 1,\ y\to -1$, we get $$f(0)=f(1)f(-1)-f(-1)+1$$ $$f(1)f(-1)-f(-1)=0$$ $$f(-1)(f(1)-1)=0$$ $$f(-1)=0\vee f(1)=1$$
So, no we have three possible cases to consider and I have no idea on how to proceed on any of them. I would appreciate any hints before giving the full solution as in the best case that's all I need right now.