Problem

Source: 2022 IMOC A4

Tags: function, algebra



Let the set of all bijective functions taking positive integers to positive integers be $\mathcal B.$ Find all functions $\mathbf F:\mathcal B\to \mathbb R$ such that $$(\mathbf F(p)+\mathbf F(q))^2=\mathbf F(p \circ p)+\mathbf F(p\circ q)+\mathbf F(q\circ p)+\mathbf F(q\circ q)$$for all $p,q \in \mathcal B.$ Proposed by ckliao914