A contest math problem 
Let $P(x)$ be a polynomial with integer coefficients of degree $d>0$.
  
  
*
  
*If $\alpha $ and $\beta $ are two integers such that $P(\alpha)=1$ and $P(\beta)=-1$, then prove that $|\beta -\alpha | $ divides $2$.
  
*Prove that the number of distinct integer roots of $(P(x))^2-1$ is at most $d+2$.
  

First one is very easy. But I cannot understand how to prove the second one. I would appreciate any help.
 A: The first part is obvious. Since $\alpha,\beta, P(\alpha)$ and $P(\beta)$ are all integers, $\mid \beta - \alpha \mid$ divides $\mid P(\beta) - P(\alpha) \mid = 2$.
For the second part, notice that $(P(x))^2-1=(P(x)+1)(P(x)-1)$. So, all the roots of those two polynomials would be a root of this polynomial. There are $2d$ such (not necessarily distinct) roots. Now, it's true for $d=1,2$ as $d+2 \geq 2d$. For $d \geq 3$, suppose there are more than $d+2$ such roots. So, there has to be at least $3$ roots of each of those two polynomials. It's not possible to have $6$ distinct integers such that any two of them are apart by $1$ or $2$. Hence, we cannot have more than $d+2$ distinct integer solutions.(thanks to @almagest) Imagine a numberline. WLOG, Let $P(a)=1$. Now, the $3$ integer roots of $P(x)=-1$ would have to be of the form $a \pm r, r=1 \text{or}\, 2$. It's easy to see that whatever integer we choose next, it'd differ by more than $2$ with at least one of these roots. Hence, we cannot have more than $d+2$ solutions.
