Polynomial mod n Suppose there is an integer polynomial, $P(x),$ such that $\text{Deg}(P)=k$. Is it possible for the equation $$P\equiv 0 \pmod{n}$$ has more than $k$ roots? For which $n$? ($n$ is an positive integer)
I have no idea how to do this. I did normal modules, I did polynomial. But when it's mixed up I am confused.
Any help appreciated.
 A: If $n$ is a prime then this is not possible because then $\Bbb{Z}_n$ would be a field. Otherwise, funny things will happen.
Consider the descending factorial polynomial
$$
f_\ell(x)=x(x-1)(x-2)\cdots(x-\ell+1).
$$
For all integers $m\ge\ell$ we have
$$
f_\ell(m)=\ell!\binom{m}{\ell}.
$$
This means that modulo $n=\ell!$ the polynomial $f_\ell$, of degree $\ell$ has $\ell!$ pairwise non-congruent zeros modulo $\ell!$, i.e. it vanishes everywhere.

The description of polynomials $\in\Bbb{Z}[x]$ that vanish at all residue classes modulo a given natural number has been rediscovered multiple times in 1900's. Names Dickson, Carlitz, Niven, Warren, and Singmaster at least have been involved.

For which $n$ can we have more than $\deg P$ zeros? Let's exclude the cheating case of all coefficients divisible by $n$. Assuming that, it is possible whenever $n$ is not a prime number. If $n=pn_1$, $p$ a prime, then the polynomial $$P(x)=n_1(x^p-x).$$ vanishes modulo $n$ for all $x\in\Bbb{Z}.$ This is because $x^p-x$ is divisible by $p$ for all $x\in\Bbb{Z}.$ Little Fermat.
But that also smacks of cheating. A more interesting variant is to also require $P(x)$ to be monic. We can make the following observations.


*

*If $n$ is divisible by two distinct odd primes, say $p$ and $q$, then the polynomial $P(x)=x^2-1$ has at least four non-congruent solutions. Namely, if $n=p^aq^bn'$ with $\gcd(n',pq)=1$ then the fours systems of congruences $x\equiv\pm 1\pmod{p^a}$, $x\equiv \pm1\pmod{q^b}$ and $x\equiv 1\pmod {n'}$ each have solutions mod $n$, and thus we have a quadratic polynomial with at least four pairwise non-congruent zeros.

*If $n$ is divisible by the square of an odd prime $p$, say $n=p^an', a\ge2,\gcd(p,n')=1$, then the polynomial $P(x):=f_{ap}(x)=\prod_{j=0}^{ap-1}(x-j)$ from above only has values divisible by $(ap)!$, hence divisible by $p^a$. So, with the factor $p^a$ automatic, a residue class of $x\pmod n$ is a zero of $P(x)$ if
$x\equiv 0\pmod{n'}$. The number of non-congruent zeros is thus at least $p^a>ap=\deg P(x)$ (and often a lot more as any $x\equiv t \pmod{n'},0\le t<ap$ will also be a zero).

*If $n$ is divisible by eight, then, again, $x^2-1$ has at least four zeros.

*If $n=2p$ where $p$ is an odd prime, then $P(x)=x^p-x$ vanishes always modulo $n$.

*If $n=4p$, $p$ and odd prime, then $P(x)=x^p-x$ vanishes whenever $x\equiv0,1\pmod 4$, so it has at least $2p$ zeros.


This leaves the case $n=4$ as the only possibility in addition to the cases $n=p$. Unless I made a mistake, a brute force check reveals that the number of non-congruent zeros of a monic polynomial modulo four is bounded from above by the degree of the polynomial.

The degree of a monic polynomial gives an upper bound to the number of its pairwise non-congruent zeros modulo $n$ if and only if $n$ is either a prime number or $n=4$.

A: Yes, this is possible.  Consider the case $n=12$. Modulo $12$, the polynomial $x^2 - 1$ has $four$ distinct zeroes in the set $\{0, 1, \dots 11\}$, namely $1, 5, 7$ and $11$.
The reason this phenomenon occurs is because the ring $\mathbb Z_{12}$ is not an integral domain, and therefore $\mathbb Z_{12}[x]$ is not a unique factorization domain.  In particular, the polynomial $x^2-1$ has two distinct factorizations mod $12$:
$$x^2 - 1 = (x-1)(x-11)$$
and also
$$x^2 - 1 = (x-5)(x-7)$$
On the other hand if $p$ is prime then $\mathbb Z_p$ is a field, and therefore $\mathbb Z_p[x]$ will be a unique factorization domain. In this case, this kind of thing can't happen -- a degree $k$ polynomial  can never have more than $k$ distinct roots in $\mathbb Z_{p}$.
Edited: Here is a more detailed description of how to construct an example like the above.
Let $n$ be composite, and suppose $a,b$ are two distinct nonzero numbers in the set $\{1,2, \dots, n-1\}$ with suppose $ab\equiv 0 \mod n$.  (Note that if $n=p^2$ for some prime $p$ it is not possible to find two distinct values like this.)  Choose another integer $r \in \{0, 1, \dots, n-1\}$.  Then find $c, d \in \{0, 1, \dots n-1\}$ such that $r - c \equiv a$ and $r - d \equiv b$ (both $\mod n$).  Note that by construction, $a,b \ne 0$ implies that $r \ne c$ and $r \ne d$.
Then consider the polynomial $p(x)=(x-c)(x-d)$.
On the one hand, it is clear that
$$p(c) = (c-c)(c-d) = 0$$
$$p(d) = (d-c)(d-d) = 0$$
but also
$$p(r) = (r-c)(r-d) = ab = n \equiv 0$$
So $p(x)$ is a quadratic polynomial with (at least) three distinct roots $r, c, d$.
The example at the top of this answer was produced following this exact method using $a=4, b=6$ and $r=5$. 
