Problem

Source: Mexico National Olympiad Mock Exam 2019 P3

Tags: functional equation, algebra



Let $\mathbb{Z}$ be the set of integers. Find all functions $f: \mathbb{Z}\rightarrow \mathbb{Z}$ such that, for any two integers $m, n$, $$f(m^2)+f(mf(n))=f(m+n)f(m).$$ Proposed by Victor Domínguez and Pablo Valeriano