Question:
Let $f:\mathbb{R}\to\mathbb{R}$ be a polynomial of degree $n$. Suppose there exists an integer $m\in\mathbb{Z}$ such that $f(m)\in\mathbb{Z}$, $f(m+1)\in\mathbb{Z}$, ..., $f(m+n)\in\mathbb{Z}$ (i.e. there exists $n+1$ consecutive integers all satisfying $f(x)\in\mathbb{Z}$). Prove that $\forall x\in\mathbb{Z}, f(x)\in\mathbb{Z}$.
Context:
This is a problem I thought of on my own when I was preparing for a contest next month. This problem at first glance "felt" like one of those classic and old problem with lots of solutions and thoughts around it. Surprisingly, I could find neither solutions nor questions regarding the same problem.
After spending a while on the problem, I came up with a finite difference solution. The solution is as follows:
My solution:
Let $P(n)$ denote the statement we want to prove for a function of degree $n$. We shall prove that $P(n)$ is true for all $n$ by induction.
Base case: When $n=0$, $f(x)=c$ where $c$ is a constant. Since $f(m)\in\mathbb{Z}$, we have $c\in\mathbb{Z}$, which means that $\forall x\in\mathbb{Z}, f(x)=c\in\mathbb{Z}$. Hence, $P(0)$ is true.
Induction hypothesis: $P(k)$ is true where $k\in\mathbb{Z}^+$.
Inductive step: We claim that $P(k+1)$ is true. We have the condition that there exists an integer $m\in\mathbb{Z}$ such that $f(m)\in\mathbb{Z}$, $f(m+1)\in\mathbb{Z}$, ..., $f(m+k+1)\in\mathbb{Z}$.
Consider a function $g(x)=f(x)-f(x-1)$ (i.e. first finite difference). Since $f(x)$ has degree $k+1$, we have that $g(x)$ has degree $k$. From the conditions given we also know that $$g(m+1)=f(m+1)-f(m)\in\mathbb{Z} \\ g(m+2)=f(m+2)-f(m+1)\in\mathbb{Z} \\ \dots \\ g(m+k+1)=f(m+k+1)-f(m+k)\in\mathbb{Z}$$
Hence, we have $k+1$ consecutive integers all satisfying $g(x)\in\mathbb{Z}$. By the induction hypothesis, this means that $\forall x\in\mathbb{Z}, g(x)\in\mathbb{Z}$. Then, we have $$f(m+k+2)=f(m+k+1)+g(m+k+2)\in\mathbb{Z} \\ f(m+k+3)=f(m+k+2)+g(m+k+3)\in\mathbb{Z} \\ \dots$$ and $$f(m-1)=f(m)-g(m)\in\mathbb{Z} \\ f(m-2)=f(m-1)-g(m-1)\in\mathbb{Z} \\ \dots$$
It can now be easily proven by induction that $\forall x\in\mathbb{Z}, f(x)\in\mathbb{Z}$. This completes the induction, $Q.E.D.$
First I'd like to ask you to verify if my proof is correct (and the spaces for improvements). Second, I'd also like to ask for more insightful and/or elegant proofs (or any generalisation from this). Any help is appreciated!