Problem

Source: P1 francophone math olympiad senior 2022

Tags: algebra, functional equation, function



find all functions $f:\mathbb{Z} \to \mathbb{Z} $ such that $f(m+n)+f(m)f(n)=n^2(f(m)+1)+m^2(f(n)+1)+mn(2-mn)$ holds for all $m,n \in \mathbb{Z}$