Putnam 1992 
Topic: Number Theory Algebra

Problem: Find the integer-valued function $f(n)$ defined on the integers that satisfies the following conditions. \begin{itemize} \item[(i)] $f(f(n)) = n$, for all integers $n$; \item[(ii)] $f(f(n+2)+2) = n$ for all integers $n$; \item[(iii)] $f(0) = 1$. \end{itemize}

Solution: If $f(n) = 1 - n$, then $f(f(n)) = f(1 - n) = 1 - (1 - n) = n$, so (i) holds. Similarly, $f(f(n + 2) + 2) = f((-n - 1) + 2) = f(1 - n) = n$, so (ii) holds. Clearly (iii) holds, and so $f(n) = 1 - n$ satisfies the conditions.

Conversely, suppose $f$ satisfies the three given conditions. From condition (ii), $f(f(f(n + 2) + 2)) = f(n)$, and applying (i) yields $f(n + 2) + 2 = f(n)$ or $f(n + 2) = f(n) - 2$. An easy induction yields

\[ f(n) = \begin{cases} f(0) - n & \text{if } n \text{ is even,} \\ f(1) + 1 - n & \text{if } n \text{ is odd.} \end{cases} \]

If $f(0) = 1$, then $f(1) = 0$ by (i), therefore, $f(n) = \boxed{1 - n}$.