Problem

Source: Mongolia 1999 Teachers secondary level P1

Tags: fe, functional equation, algebra



Suppose that a function $f:\mathbb R\to\mathbb R$ is such that for any real $h$ there exist at most $19990509$ different values of $x$ for which $f(x)\ne f(x+h)$. Prove that there is a set of at most $9995256$ real numbers such that $f$ is constant outside of this set.