Problem

Source: EMC 2023 Seniors P4

Tags: EMC 2023, 2023, functional equation, function, Ivan Novak orz, evan orz



Let $f\colon\mathbb{N}\rightarrow\mathbb{N}$ be a function such that for all positive integers $x$ and $y$, the number $f(x)+y$ is a perfect square if and only if $x+f(y)$ is a perfect square. Prove that $f$ is injective. Remark. A function $f\colon\mathbb{N}\rightarrow\mathbb{N}$ is injective if for all pairs $(x,y)$ of distinct positive integers, $f(x)\neq f(y)$ holds. Ivan Novak