In what conditions a quadratic function has an integer value of $f(x)$ where $x$ is also an integer? EDITED
Sorry, the question was wrong. Please forgive me for this.
Suppose a quadratic function $f(x) = ax^2+bx+c$, what I want to know is if in an integer $x$, say $x=1, x=2, x=3, ...$, the function has also a corresponding integer value of $y$ or not ($y=1, y=2, y=5, ...$). Is there a way?
 A: Hint: Set up
 $$ a(x- \alpha_1)(x - \alpha_2) = a x^2 + b x +c $$ 
where: $\alpha_1 , \alpha_2 \in \mathbb{Z}$ are the integer roots of the quadratic equation.
After that $\alpha_1 + \alpha_2 = - \frac{b}{a} ;  \alpha_1 \alpha_2 = \frac{c}{a}$
I just realized that the above equations follow Vieta's formulas, then you can consider the cases to $\alpha_1 , \alpha_2 \in \mathbb{Z}$
A: For the revised question, you have $$f(0)=c$$So $c$ must be an integer, and $g(x)=f(x)-c=ax^2+bx$ will be an integer whenever $f(x)$ is an integer.
Now $g(1)=a+b$ and $g(-1)=a-b$ so we must have both $2a=g(1)+g(-1)$ and $2b=g(1)-g(-1)$ are integers. We also require $a\pm b$ are integers - so either $a,b$ are both integers or they are both half of odd integers. i.e. there are integers $c,d$ with $c=2a, d=2b$ and $2\mid c-d$
Note that $$g(x\pm1)=ax^2\pm 2ax+a+bx\pm b=g(x)\pm 2ax+(a\pm b)$$ and the conditions above are sufficient to ensure that this is an integer if $g(x)$ is. And of course $g(0)=0$.
A: A basis for the integer-valued polynomials (of whatever degree), as a $\mathbf Z$-module, is made up of the `binomial polynomials:
$$P_k(x)=\frac{x(x-1)\dotsm(x-k+1)}{k!}$$
Hence a quadratic integer-valued polynomial has the form:
$$f(x)=a\frac{x(x-1)}2+bx+c,\qquad(a,b,c\in\mathbf Z).$$
