Let $f : \mathbb R \longrightarrow \mathbb R$ be a $C^{\infty}$-function such that $f(x) = 0$ iff $x \in \mathbb Z.$ Suppose that the function $x : \mathbb R \longrightarrow \mathbb R$ satisfies $x'(t) = f(x(t)),$ for all $t \in \mathbb R.$ If $\mathbb Z \cap \{x(t)\ |\ t \in \mathbb R\}$ is non-empty then $x$ is a constant.
This question appeared in one of the entrance examinations. It is clear that $x'(t_0) = 0,$ for some $t_0 \in \mathbb R.$ But how do I show that $x'(t) = 0,$ for all $t \in \mathbb R\ $? Any help would be much appreciated.
Thanks!