Problem

Source: 2021 China TST, Test 1, Day 2 P4

Tags: algebra, polynomial, number theory, modular arithmetic



Let $f(x),g(x)$ be two polynomials with integer coefficients. It is known that for infinitely many prime $p$, there exist integer $m_p$ such that $$f(a) \equiv g(a+m_p) \pmod p$$holds for all $a \in \mathbb{Z}.$ Prove that there exists a rational number $r$ such that $$f(x)=g(x+r).$$