# Find all functions that satisfy the following conditions

Find all functions $f:\mathbb Z\to \mathbb Z$ that satisfy the following conditions:

(i) $f (0) = 1$

(ii) $f(f (x)) = x$ for all integers x

(iii) $f(f(x + 1)+1) = x$ for all integers x

How do you prove it with induction

• As in my argument below, we know that $f(x)=f(x+1)+1$ for all integers $x$. Now let us prove that $f(n)=1-n$ and that $f(-n)=1+n$ for all positive integers $n\geq 1$. The induction start is easy: we know that $f(0)=f(1)+1$ and that $f(-1)=f(0)+1$. As $f(0)=1$, it follows that $f(1)=0$ and $f(-1)=2$. If it holds for some $n\geq 1$ that $f(n)=1-n$ and $f(-n)=1+n$, then $f(n)=f(n+1)+1$, implying $f(n+1)=f(n)-1=-n=1-(n+1)$, and $f(-(n+1))=f(-n)+1$, implying $f(-(n+1))=1+n+1=2+n=1+(n+1)$. Hence it follows that $f(n)=1-n$ and $f(-n)=1+n$ for all integers $n\geq 1$, so that $f(x)=1-x$. – Bryder Apr 14 '14 at 19:28

Quite straightforward. $f$ is a bijection by (ii), so (ii) and (iii) imply $f(x)=f(x+1)+1$. Now $f(n)=f(n-1)-1=f(n-2)-2=f(n-3)-3=\ldots=f(0)-n=1-n$ and $f(-n)=f(1-n)+1=\ldots=f(0)+n=1+n$ for all integers $n>0$, so that $f(x)=1-x$ for all integers $x$. Induction is of course also applicable.
By (ii), $$f(f(0))=f(1)=0$$ By (iii) $$f(f(-1+1)+1)=f(f(0)+1)=f(2)=-1$$ So $$f(f(2))=f(-1)=2$$ So $$f(f(-2+1)+1)=f(f(-1)+1)=f(3)=-2$$ So $$f(f(3))=f(-2)=3$$ So $$f(f(-3+1)+1))=f(4)=-3$$ So...
• So, the solution is $f(x)=-x+1$. – user35603 Apr 14 '14 at 15:41