Problem: A function $f \colon \QQ \to \QQ$ is called \emph{aquaesulian}
if the following property holds: for every $x,y \in \mathbb{Q}$,
\[ f(x+f(y)) = f(x) + y \quad \text{or} \quad f(f(x)+y) = x + f(y). \]
Show that there exists an integer $c$ such that for any aquaesulian function $f$
there are at most $c$ different rational numbers of the
form $f(r) + f(-r)$ for some rational number $r$,
and find the smallest possible value of $c$.

\end{enumerate}

Solution: We will prove that
\[ \left\{ f(x) + f(-x) \mid x \in \QQ \right\} \]
contains at most $2$ elements
and give an example where there are indeed $2$ elements.

We fix the notation $x \to y$ to mean that $f(x+f(y)) = f(x)+y$.
So the problem statement means that either $x \to y$ or $y \to x$ for all $x$, $y$.
In particular, we always have $x \to x$, and hence
\[ f(x+f(x)) = x+f(x) \]
for every $x$.

\paragraph{Construction.}
The function
\[ f(x) = \left\lfloor 2x \right\rfloor - x \]
can be seen to satisfy the problem conditions.
Moreover, $f(0)+f(0) = 0$ but $f(1/3)+f(-1/3) = -1$.

\begin{remark*}
  Here is how I (Evan) found the construction.
  Let $h(x) \coloneq x+f(x)$, and let $S \coloneq h(\QQ) = \{h(x) \mid x \in \QQ\}$.
  Hence $f$ is the identity on all of $S$.
  If we rewrite the problem condition in terms of $h$ instead of $f$,
  it asserts that at least one of the equations
  \begin{align*}
    h(x+h(y)-y) &= h(x)+h(y) \\
    h(y+h(x)-x) &= h(x)+h(y)
  \end{align*}
  is true.
  In particular, $S$ is closed under addition.

  Now, the two trivial solutions for $h$ are $h(x) = 2x$ and $h(x) = 0$.
  To get a nontrivial construction, we must also have $S \neq \{0\}$ and $S \neq \QQ$.
  So a natural guess is to take $S = \ZZ$.
  And indeed $h(x) = \left\lfloor 2x \right\rfloor$ works fine.
\end{remark*}
\begin{remark*}
  This construction is far from unique. For example,
  $f(x) = 2\left\lfloor x \right\rfloor - x = \left\lfloor x \right\rfloor - \{x\}$
  seems to have been more popular to find.
\end{remark*}

\paragraph{Proof (communicated by Abel George Mathew).}
We start by proving:
\begin{claim*}
  $f$ is injective.
\end{claim*}
\begin{proof}
  Suppose $f(a) = f(b)$. WLOG $a \to b$. Then
  \[ f(a)+a = f(a+f(a)) = f(a+f(b)) = f(a)+b \implies a=b. \qedhere. \]
\end{proof}

\begin{claim*}
  Suppose $s \to r$.
  Then either $f(r) + f(-r) = 0$ or $f(f(s)) = s+f(r)+f(-r)$.
\end{claim*}
\begin{proof}
  Take the given statement with $x = s+f(r)$ and $y = -r$; then
  \begin{align*}
    x + f(y) &= s + f(r) + f(-r) \\
    y + f(x) &= f(s+f(r)) - r = f(s).
  \end{align*}
  Because $f$ is injective, if $x \to y$ then $f(r) + f(-r) = 0$.
  Meanwhile, if $y \to x$ then indeed $f(f(s)) = s + f(r) + f(-r)$.
\end{proof}

Finally, suppose $a$ and $b$ are different numbers for which
$f(a)+f(-a)$ and $f(b)+f(-b)$ are both nonzero.
Again, WLOG $a \to b$.
Then
\[ f(a) + f(-a) \overset{a \to a}{=} f(f(a))-a \overset{a \to b}{=} f(b) + f(-b). \]
This shows at most two values can occur.

\begin{remark*}
  The above solution works equally well for $f \colon \RR \to \RR$.
  But the choice of $\QQ$ permits some additional alternate solutions.
\end{remark*}

\begin{remark*}
  After showing $f$ injective,
  a common lemma proved is that $-f(-f(x)) = x$, i.e.\ $f$ is an involution.
  This provides some alternative paths for solutions.
\end{remark*}