# Functional equation.

I'm trying to solve the functional equation $f(x+f(y)) = f(x)-y$ where $f : \mathbb{Z} \to \mathbb{Z}$. What I got so far is: $f$ is injective and $f(0) = 0$. Thanks in advance for your time.

As you have observed, $f$ must be injective and satisfy $f(0)=0$. Now for any fixed $a\in\mathbb{Z}$, setting $y=a$ and $x=0$ gives $f(f(a))=-a$, and then setting $x=f(a)$ gives $f(2f(a))=-2a$. You can continue similarly to find $f(nf(a))=-na$ for each $n\in\mathbb{N}$. You can also get $f(nf(a))=-na$ for negative integers $n$ by applying this argument backwards (for instance, for $n=-1$ set $x=-f(a)$).
Thus $f(nf(a))=-na$ for each $n\in\mathbb{Z}$. In particular, if $n=f(b)$ for some $b\in\mathbb{Z}$, this says $$f(f(a)f(b))=-f(b)a=-f(a)b,$$ since you can swap the roles of $a$ and $b$. Thus assuming $a,b\neq 0$, we find $f(a)/a=f(b)/b$. Since $a$ and $b$ were arbitrary, this means there is a constant $c\in\mathbb{Z}$ (the common value of $f(a)/a$) such that $f(x)=cx$ for all $x\in\mathbb{Z}$. Plugging $f(x)=cx$ back into the functional equation gives $$c(x+cy)=cx-y,$$ so $c^2=-1$. Since no integer can satisfy this, there are no functions which satisfy the functional equation.
• Just one thing: I don't follow you when you say, setting $x = f(a)$ gives $f(2(f(a)) = -2a$. Can you give me any hint please? Thanks. – Topologicalife Apr 29 '16 at 22:41
• Okay, I got it. We have to set $y=a$ and $x = f(a)$ so we have $f(f(a) + f(y)) = f(x) - y \iff f(2f(a)) = -2a$ thanks :) :) – Topologicalife Apr 29 '16 at 22:55
• @EricWofsey Please explain why $f(0)=0$? – Hamid Reza Ebrahimi Sep 27 '17 at 15:39
• We can also get $f(x)=cx$ by plugging first $x=-f(y)$ to get $f(-f(y))=y$ and then plugging $y=-f(y)$ to obtain Cauchy's functional equation $f(x+y)=f(x)+f(y)$, for which the result is known. – Sil May 12 at 10:47