Problem

Source: Turkey Olympic Revenge 2023 P4

Tags: functional equation, number theory, Revenge



Find all functions $f: \mathbb{Z}\to \mathbb{Z}$ such that for all integers $x$ and $y$, the number $$f(x)^2+2xf(y)+y^2$$is a perfect square. Proposed by Barış Koyuncu