f can be any function such that f(2km)=f(2k) for any k≥0 and odd m, where f(0),f(1),f(2),f(22),… are arbitrary integers.
We label the equation as follows.
f(x)+f(y)=f(x+2xy)+f(y−2xy)(1)
Putting x=1 and y=n in (1), we obtain
f(1)+f(n)=f(2n+1)+f(−n).(2)
Putting x=n and y=−1 in (1), we obtain
f(n)+f(−1)=f(−n)+f(2n−1).(3)
Since f(1)=f(−1), by comparing (2) and (3), we immediately obtain
f(2n+1)=f(2n−1)
for any n∈Z. It follows that f(m)=f(1) for any odd m. Using (2), we obtain
f(n)=f(−n)
for any n∈Z.
Next, we put x=−2k−1 and y=n in (1). Since both x and x+2xy=x(1+2y) are odd, we obtain
f(n)=f((4k+3)n).
Replacing k by −(k+1), and using f(m)=f(−m), we get
f(n)=f((−4k−1)n)=f((4k+1)n).
Combining these, we know that f(n)=f(mn) for any odd m. Therefore, by writing n=2km where m is odd, we find that
f(2km)=f(2k).
It remains to check that all such functions satisfy all the conditions. Firstly, f(−1)=f(1) is true. Secondly, Note that v2(x+2xy)=v2(x(1+2y))=v2(x) and similarly v2(y−2xy)=v2(y). Therefore, we must have
f(x+2xy)=f(x),f(y−2xy)=f(y).
This proves (1), and we are done.