Proving that a function is odd Assume that there exists a function $f:\mathbb{R}\to\mathbb{R}$ that is bijective and satisfies
$$
f(x) + f^{-1}(x)=x
$$
for all $x$. Here $f^{-1}$ is the inverse function. Show that $f$ is odd.
This was a brain-teaser given to me by a friend. Two other related questions are:


*

*Show that $f$ is discontinuous

*Give an example of such a function (if indeed one exists).


Edit: As an initial idea, maybe approaching the problem graphically would help? A function and its inverse are reflections of each other about $y=x$ on the $x$-$y$ plane. Does this lead to anywhere?
 A: If $f$ were continuous, then it would have to be strictly monotonic, since it's bijective.  Suppose $f$ is decreasing, $x>0$.  Then, since $f(0)=0$ we get $f(x)<0$ and $f^{-1}(x)<0$, but $x=f(x)+f^{-1}(x)$.  So $f$ is increasing and $f(x)>0$ when $x>0$.  But then, $f^{-1}(x)$ is also positive for $x>0$, so $f(x)<x$.  Since $f$ is increasing, $f^{-1}(x)>x$.  But that's not possible.  
A: Let's call $(E)$ the equation $f(y) + f^{-1} (y) = y$
Let $a \in \mathbb{R}$. Since $f$ is bijective, there exists $x \in \mathbb{R}$ such that $f(x) = a$. Now, since $f^{-1}(a) = x$, we have (using $(E)$ with $y = a$) $f(a) = a - x$. Now, using $(E)$ with $y = x$:
$$f^{-1}(x) = x - a$$
Applying $f$ on both side:
$$f(x-a) = x $$
Using $(E)$ with $y = x-a$:
$$f^{-1}(x-a) = x - a - f(x -a) = x -a -x = a$$
Applying $f$ on both side:
$$f (-a ) = x -a $$.
Thus $f(a) = a - x = -f(-a)$. This is true for all $a \in \mathbb{R}$: $f$ is therefore odd.
A: Here is finally a constructive example of a solution, continuous except on a countable set.
Let $\phi = \frac{1+\sqrt5}{2}$, and let
$$f(x) =  \begin{cases} 
      0 & \text{if }x = 0 \\
      -\phi x & \text{if }|x| \in [\phi^{3k}, \phi^{3k+1}), k \in \mathbb Z \\
      \phi x & \text{if } |x| \in [\phi^{3k+1}, \phi^{3k+2}), k \in \mathbb Z \\
      \phi^{-2} x & \text{if } |x| \in [\phi^{3k+2}, \phi^{3k+3}), k \in \mathbb Z \\
   \end{cases}
$$
Then $f$ is a bijection, whose inverse is
$$f^{-1}(x) =  \begin{cases} 
      0 & \text{if }x = 0 \\
      \phi^2 x & \text{if }|x| \in [\phi^{3k}, \phi^{3k+1}), k \in \mathbb Z \\
      -\phi^{-1} x & \text{if } |x| \in [\phi^{3k+1}, \phi^{3k+2}), k \in \mathbb Z \\
      \phi^{-1} x & \text{if } |x| \in [\phi^{3k+2}, \phi^{3k+3}), k \in \mathbb Z \\
   \end{cases}
$$
Checking each case shows that $f(x)+f^{-1}(x) = x$, as required.

A: By plugging in $x=f(y)$ we obtain:
$$
f(f(y))=f(y)-y
$$
Call this assertion $P(y)$ and let $f^{(n)}(x)=\underbrace{f(f(…f(x)...))}_{n \space times}$. Now we have:
$$
P(f(x)): f^{(3)}(x)=f(f(x))-f(x)=f(x)-x-f(x)=-x \iff f^{(4)}(x)=f(-x) 
$$
But:
$$
P\left(f(f(x))\right): f^{(4)}(x)=f^{(3)}(x)-f^{(2)}(x)=-x-(f(x)-x)=-f(x)
$$
By combining these equations, we obtain $f(-x)=-f(x)$ and therefore, $f$ is odd.
A: Proof that the function is odd (if it exists):
Suppose that $f(b)=a$.  Now, consider
$$f(b)+f^{-1}(b)=b.$$
Then, $f^{-1}(b)=b-a$ or that $f(b-a)=b$.  Now, consider
$$f(b-a)+f^{-1}(b-a)=b-a.$$
By substitution, we have $b+f^{-1}(b-a)=b-a$ or that $f^{-1}(b-a)=-a$.  Therefore, $f(-a)=b-a$.  Now, consider 
$$
f(-a)+f^{-1}(-a)=-a.
$$
By substitution, $b-a+f^{-1}(-a)=-a$ or that $f^{-1}(-a)=-b$.  In other words, $f(-b)=-a$, so the function is odd.
A: First, as others have noted, we must have $f(0) = 0$. Let us now "construct" such a function on $\mathbb R^{*}$ using the Axiom of Choice.
Using $f(x) = x - f^{-1}(x)$, it is easy to see that, if $A \in \mathbb R^{*}$ is such that $f(A) = B$, then the following cycle must occur:
$$A \mapsto B \mapsto B - A \mapsto -A \mapsto -B\mapsto A-B \mapsto A$$
(Note that this proves that the function is odd.)
Therefore, an idea to construct such a function is for instance to set $B = -2A$, so that we have the following cycle:
$$A \mapsto -2A \mapsto -3A \mapsto -A \mapsto 2A \mapsto 3A \mapsto A$$
If we could partition $\mathbb R^{*}$ into sets of the form $\{-3A,-2A,-A,A,2A,3A\}$, we could easily define the function on each of these sets using the cycle above. 
To do so, we can use the Axiom of Choice and take the quotient of $\mathbb R^{*}$ by the equivalence relation $$A \equiv B \Leftrightarrow \exists (p,q) \in \mathbb Z^2, A = \pm 2^p 3^q B$$
The Axiom of Choice gives us a set $X$ such that $\mathbb R^{*} = \coprod_{A \in X} \bigcup_{(p,q)\in\mathbb Z^2}\{\pm2^p3^qA\}$.
Then, for each $A\in X$, we can construct $f$ on $E_A =  \bigcup_{(p,q)\in\mathbb Z^2}\{\pm2^p3^qA\}$. Indeed, since $\mathbb Z^2$ is countable, we can order it and use induction to build our cycles. When considering the $n$-th element of $\mathbb Z^2$, either it does not appear in a cycle formed by one of the previous elements of $\mathbb Z^2$, in which case we build $f$ on the cycle formed by the current element; or it does, in which case we skip the element.
It is easy to check that the function built this way has the required properties. 
Note that I have no idea if we can build such a function without using the Axiom of Choice, but I doubt so. 
Edit: I finally found a constructive solution, see my other answer. (If it is inappropriate to double-post, I will merge both answers.)
