TITLE: How to construct integer polynomial of degree $n$ which takes $n$ times the value $1$ and $n$ times the value $-1$ (in integer points)
QUESTION [5 upvotes]: Question is like in title:

For positive integer $n$ I want to construct a polynomial $w(x)$ of degree $n$ with integer coefficients such that there exist $a_1<a_2<\cdots<a_n$ (integer numbers) satisfying $w(a_1)=w(a_2)=\cdots=w(a_n)=1$ and $b_1<b_2<\cdots<b_n$ (also integer numbers) satisfying $w(b_1)=w(b_2)=\cdots=w(b_n)=-1$. 

I am not sure if such polynomial even exists for every $n$.
EDIT: $a_i, b_i$ are not predetermined, as someone mentioned in a comment.

REPLY [3 votes]: $\newcommand{\Size}[1]{\left\lvert #1 \right\rvert}$$\newcommand{\Set}[1]{\left\{ #1 \right\}}$Just to complement the excellent answer (+1), if $n = 1$ you have
$$
w(x) = C (x - a_{1}) + 1,
$$
and 
$$w(b_{1}) = C (b_{1} - a_{1}) = -2,$$
so there is a solution iff $b_{1} - a_{1} \in \Set{\pm 1, \pm 2}$.
If $n = 2$ you have
$$
w(x) = C (x - a_{1})(x - a_{2}) + 1,
$$
and need
$$
C (b_{1} - a_{1})(b_{1} - a_{2}) = -2 = C (b_{2} - a_{1})(b_{2} - a_{2}),
$$
and there are solutions for instance for
$$\tag1\label1
b_{1} = a_{1} + 1 = a_{2} - 2,
$$
so that $a_{2} = a_{1} + 3$
and
$$\tag2\label2
b_{2} = a_{1} + 2 = a_{2} - 1,
$$
say $a_{1} = 0, a_{2} = 3, b_{1} = 1, b_{2} = 2$, and then $C = 1$.
Actually, for the case $n = 2$ we have
$$
a_{2} - a_{1} = \Size{a_{2} - a_{1}}
\le \Size{b_{1} - a_{1}} + \Size{b_{1} - a_{2}} \le 3,
$$
so I think the general conditions for the existence of a solution are indeed $\eqref1$ and $\eqref2$.