# Find $f(3)$ if $f(f(x))=x^{2}+2$

Let $$a,b,f(x),x$$ be positive integers such that If $$a>b$$ then $$f(a)>f(b)$$ and $$f(f(x))=x^{2}+2$$ . Find $$f(3)$$

My approach:

Replacing $$x$$ with $$f(x)$$ in the equation gives $$f(f(f(x))) = f(x)^2 + 2$$, but $$f(f(x)) = x^2 + 2$$ so $$f(x^2+2) = f(x)^2 + 2$$ how do i proceed after this. Please help. Thanks alot!

• Since $f$ is increasing set $f(1)=a$ then $f(a)=3$ there are only $1,2$ values below. can you infer some upper bound for $a$ ?
– zwim
Nov 8, 2021 at 19:50
• For what it's worth, the problem is poorly written. One of the premises is that if $x \in \Bbb{Z^+}$, then $f(x) \in \Bbb{Z^+}.$ This premise is not obvious from the problem's presentation - i.e. the statement "let ... $f(x), x$, be positive integers". Nov 8, 2021 at 19:55
• I'm not seeing how you made the observation $f(x^2+2)=(f(x))^2+2$....
– Mike
Nov 8, 2021 at 19:56
• The answer of lulu is conclusive. Another way of summarizing the answer of lulu is that $f(1)$ must be a positive integer, $f(1)$ must be $> 1$, and $f(1)$ must be $< 3$. Nov 8, 2021 at 19:57
• @Mike, since $f(f(f(x)))=f(x)^{2}+2$ but $f(f(x))=x^{2}+2$ so $f(x^{2}+2)=f(x)^{2}+2$ Nov 8, 2021 at 19:58

Note that $$f(f(1))=3$$ so there is some natural number $$n$$ such that $$f(n)=3$$.

If $$f(1)>3$$ then there could be no solution to $$f(n)=3$$ so we must have $$f(1)\in \{1,2,3\}$$.

If $$f(1)=3$$ then we have $$3=f(f(1))=f(3)$$, a contradiction.

If $$f(1)=1$$ then we would have $$3=f(f(1))=f(1)$$, a contradiction.

Thus $$f(1)=2$$.

It follows that $$f(2)=f(f(1))=1^2+2=3$$ from which we deduce that $$f(3)=f(f(2))=2^2+2=6$$ and we are done.

• @CalvinLin Good point. Let me see if I can repair that...
– lulu
Nov 8, 2021 at 23:43
• @CalvinLin I've rewritten to avoid that substitution. Thanks for pointing out the gap.
– lulu
Nov 8, 2021 at 23:46
• @CalvinLin Another gap should be observed as well...All we've done with this sort of reasoning is to show what the value must be assuming $f(x)$ exists. I assume that this is what the OP intended, and I didn't think about constructing an actual solution to the functional equation.
– lulu
Nov 8, 2021 at 23:48
• BrianMoehring pointed out that the substitution is actually valid. I misunderstood what OP did (in part because the details weren't listed out). Nov 9, 2021 at 19:16

Note that $$f$$ is by definition strictly monotonic. So consider: If $$f(3)<3$$ then we can only have $$f(3)=1$$ or $$f(3)=2$$. Else if $$f(3)=3$$ we have $$f(3)=f(f(3)) = 3^2+2=11$$, so this cannot be. Finally if $$f(3)>3$$ we have $$f(3) < f(f(3))=11$$.

$$f(3)=1,2$$ would imply $$f(1)=f(f(3)) = 11>f(3)$$.

Generally we get that $$f(x)$$ cannot be $$x$$, else $$x=x^2+2$$. Also $$f(f(1)) = 3$$, $$f(f(2)) = 6$$, $$f(f(3)) = 11$$. But as $$f(3)>3$$ (and $$f(x)>3$$ for $$x>3$$) this means $$f(2)=3$$.

But then $$f(3) = f(f(2)) = 6$$. Thus we’re done.

• Thank you so muchhhh!! Nov 8, 2021 at 20:04
• @BrianMoehring Could be? You appear to know better, so it’s probably that way.
– Lazy
Nov 8, 2021 at 20:17
• I've been surprised about regional uses of words before (e.g. "positive"), so I tend not to assume. Nov 8, 2021 at 20:19
• @BrianMoehring My problem here is that I’m not a native english speaker, so I’m not used to using each possible term in english. In german we just say monoton.
– Lazy
Nov 8, 2021 at 20:23
• @BrianTung I believe that in French, positive means non-negative, EG 0 is both positive and negative. I stand with Moehring on this "regional uses of words". Nov 8, 2021 at 23:51