let $f:\mathbb R\longrightarrow \mathbb R$,and for any real numbers $x,y$ have $$f(1+xy)-f(x+y)=f(x)f(y)$$ and $f(-1)\neq 0$.
Find the $f(x)$
My try:let $x=y=0$,then we have $$f(1)-f(0)=[f(0)]^2$$
let $$x=1,y=-1,\Longrightarrow f(0)-f(0)=f(1)f(-1)$$ since $f(-1)\neq 0$, so $$f(1)=0$$ so $f(0)=0 $ or $f(0)=-1$
Then I dont know what to do.
Edit: This is from IMO2012 Shortlist, Problem A5.
I pick up where Marc van Leeuwen has stopped. If we put $g(x)=f(x+1)$, his answer has shown the following fundamental properties :
$$ \begin{array}{ll} g(x)=x \ \text{when } x\in {\mathbb Z}, & (1) \\ g(2x)=2g(x) \ \text{when } x\in {\mathbb R} & (2) \\ g(-x)=-g(x) \ \text{when } x\in {\mathbb R} & (3) \\ g(x-1)+g(x+1)=2g(x) \ \text{when } x,y\in {\mathbb R} & (4) \\ g(xy)-g(x+y-1)=g(x-1)g(y-1) \ \text{when } x,y\in {\mathbb R} & (5) \\ \end{array} $$
I will deduce from those properties that $$ g(ux+v)=ug(x)+v(g(x+1)-g(x)) (\ \text{when } x\in {\mathbb R},u,v\in{\mathbb Q},u\neq 0) \tag{6} $$ Clearly, it suffices to show (6) when both $u$ and $v$ are integers. Thanks to (3), we may further assume that $u > 0$. We do this by induction on $u$.
Initial step : (i.e. $u=1$) : this follows easily from (4) alone.
Recurrence step : Suppose that the property is true for all $u' \leq u$. Using (5) with $y=u+1$, we deduce $g((u+1)x)=g(x+u)+g(x-1)g(u)$. Now $g(u)=u$ by (1), and $g(x+u)=g(x)+u(g(x+1)-g(x))$ and $g(x-1)=2g(x)-g(x+1)$ by (4). So $$ g((u+1)x)=g(x)+u(g(x+1)-g(x))+(2g(x)-g(x+1))u=(u+1)g(x) \tag{7} $$ Let us now define the auxiliary function $h(v)=g((u+1)x+v)-(u+1)g(x)-v(g(x+1)-g(x))$ for $v\in{\mathbb Z}$. By (4), $h$ is harmonic over $\mathbb Z$. But by (7) above, $h$ is zero on all multiples of $u+1$. So $h$ is zero everywhere, and we have just finished the proof of (6).
Let $t$ be any number. If we put $a=g(t)$ and $b=g(t+1)-g(t)$, then using (5) twice, first with $x=y=t$, second with $x=2t,y=2t$, we see that
$$ g(t^2)=2a-b+(a-b)^2 \ g(4t^2)=4a-b+(2a-b)^2 \tag{8} $$
But we know that $g(4t^2)=4g(t^2)$ by (2). So we must have $4(2a-b+(a-b)^2)=4a-b+(2a-b)^2$, i.e. $(b-1)(4a-3b)=0$. Since there is more than one possible value for $a$ ($a$ can be any integer), this forces $b=1$. We have just shown : $$ g(x+1)-g(x)=1 (\ \text{when } x\in {\mathbb R}) \tag{9} $$
So that (6) becomes $$ g(ux+v)=ug(x)+v (\ \text{when } x\in {\mathbb R},u,v\in{\mathbb Q}) \tag{6'} $$
Combining (6') with (5) (used with $x=y$), we have $$ g(x^2)=g(x)^2, (\ \text{when } x\in {\mathbb R}) \tag{10} $$
So $g$ is positive on ${\mathbb R}_{+}$. This positivity, together with (6'), implies that $g$ is nondecreasing. Since $g$ is the identity on ${\mathbb Q}$, it must be the identity everywhere.