# Can we obtain $f(y+x)=y+f(x)$ from $f(x^2+f(x)^2+x)=f(x)^2+x^2+f(x)$?

$\mathbb Z^+$ is the set of positive integers. Find all functions $f:\mathbb{Z}^+\rightarrow \mathbb{Z}^+$ such that $$f(m^2+f(n))=f(m)^2+n\quad(\clubsuit)$$

Let $P(x,y)$ be the assertion: $f(x^2+f(y))=f(x)^2+y \; \forall x,y \in \mathbb{Z}^+.$ $P(x,x)$ gives us $f(x^2+f(x))=f(x)^2+x$. $P(x,x^2+f(x))$ gives us $f(x^2+f(x)^2+x)=f(x)^2+x^2+f(x)$.

Can we obtain $f(y+x)=y+f(x)$ from $f(x^2+f(x)^2+x)=f(x)^2+x^2+f(x)$ ?

• The last relation is true at least for $y \in \{ x^2 + f(x)^2 : x \in \Bbb{Z}^+ \}$, but is unclear if it extends to other values of $y$ as well. In particular, sum of squares cannot cover all the positive integers. Jul 6, 2015 at 0:45
• FYI: If we replace $\mathbb{Z}_+$ with $\mathbb{R}$ then this is an old IMO problem (IMO 92 Problem 2, solution here). Jul 6, 2015 at 1:14

Notations and assumptions

1. $\circ$ denotes composition.

2. $g:= f\circ f\quad(\diamondsuit)$

Theorem$(\heartsuit)$:$\qquad g(n)=n\quad\forall\; n\in\mathbb Z^{+}$

For arbitrary $m,n\in\mathbb Z^{+}$ we have \begin{align} &\quad \color{#F0A}{g(n)^2+m^2+f(1)}\\ \stackrel{\diamondsuit,\clubsuit}=&\quad f(\color{red}{f(n)^2}+\color{blue}{f(m^2+f(1))})\\ \stackrel{\clubsuit}=&\quad f(\color{red}{f(n)^2}+\color{blue}{f(m)^2+1})\\ =&\quad f(\color{blue}{f(m)^2}+\color{red}{f(n)^2+1})\\ \stackrel{\clubsuit}=&\quad f(\color{blue}{f(m)^2}+\color{red}{f(n^2+f(1))})\\ \stackrel{\diamondsuit,\clubsuit}=&\quad \color{#F0A}{g(m)^2+n^2+f(1)}\\ \therefore&\quad g(n)^2-n^2=g(m)^2-m^2 \end{align} Note that $g(n)$ is positive and can't be $-n$. So the following are true.

$g(n)= n$ for some $n\iff g(n)= n$ for all $n$.

$g(n)\neq n$ for some $n\iff g(n)\neq n$ for all $n$.

Assuming $g(n)\neq n$ and remembering $g(n)\in\mathbb Z^{+}$ we see $$\therefore\quad\underbrace{\color{purple}{|g(n)+n|}}_{>n}\underbrace{|g(n)-n|}_{\ge1}=|g(1)^2-1^2|$$

i.e. RHS is a constant integer but LHS can be arbitrarily large which is absurd. Therefore $g(n)=n$.

Theorem$(\spadesuit)$:$\qquad f$ is strictly increasing

$$f(\color{red}{n}+\color{blue}{1})\stackrel{\heartsuit}=f(\color{blue}{1^2}+\color{red}{g(n)})\stackrel{\diamondsuit,\clubsuit}=f(1)^2+f(n)\stackrel{}>f(n)$$

Conclusion:$\qquad f(n)=n$

$n>f(n)$ yields a contradiction: $$\color{red}{n}>\color{blue}{f(n)}\stackrel{\spadesuit}\iff f(\color{red}n)>f(\color{blue}{f(n)})\stackrel{\diamondsuit}\iff f(n)>g(n)\stackrel{\heartsuit}\iff f(n)>n$$ Similarly, $n<f(n)$ yields a contradiction: $$\color{red}{n}<\color{blue}{f(n)}\stackrel{\spadesuit}\iff f(\color{red}n)<f(\color{blue}{f(n)})\stackrel{\diamondsuit}\iff f(n)<g(n)\stackrel{\heartsuit}\iff f(n)<n$$ Therefore we conclude: $$f(n)=n$$

Here is an incomplete idea to actually solve the quoted problem (as opposed to your specific question about $f(x+y)=y+f(x)$). This idea might go nowhere. Define $a$ to be $f(1)$. It's easy to show using induction that if $a=1$, then $f$ is the identity function.

If $a=2$, we can arrive at a contradiction:

\begin{align} f(1^2+f(1))&=f(1)^2+1\\ f(1+2)&=4+1\\ f(3)&=5\\ \implies f(1^2+f(3))&=f(1)^2+3\\ f(1+5)&=4+3\\ f(6)&=7\\ \implies f(1^2+f(6))&=f(1)^2+6\\ f(1+7)&=4+6\\ f(8)&=10\\ \implies f(1^2+f(8))&=f(1)^2+8\\ f(1+10)&=4+8\\ f(11)&=12 \end{align}

But \begin{align} f(3^2+f(1))&=f(3)^2+1\\ f(9+2)&=25+1\\ f(11)&=26 \end{align}

This contradiction rules out $f(1)$ being $2$. Perhaps you can find a pattern to generalize and show that $f(1)$ must be $1$, which would prove that $f$ must be the identity. (I had no luck finding such a pattern though.)

Given $$f: \mathbb{Z} \rightarrow \mathbb{Z} \wedge f(m^2 + f(n)) = f(m)^2 + n.$$ For a fixed $m$ and $n=x$ we get $$f(m^2 + f(x)) = f(m)^2 + x.$$ In general we can write $$f(x) = \sum_k a_k x^k.$$ Whence $$f'(m^2 + f(x)) f'(x) = 1.$$ Thus $f'(x) = 1$. So we obtain $$f(x) = a + x.$$ Putting it back we get $$a + [ m^2 + a + n ] = a^2 + 2 a m + m^2 + n \Rightarrow 2a = a^2 + 2 a m.$$ Whence $$a = 0.$$ So the general solutions is $$f(x) = x.$$