Problem

Source: 2022 Switzerland IMO TST, Problem 7

Tags: algebra, polynomial, real coefficients



Let $n$ be a positive integer. Find all polynomials $P$ with real coefficients such that $$P(x^2+x-n^2)=P(x)^2+P(x)$$for all real numbers $x$.