The book I'm reading introduces polynomials over a field and proves the statement that a polynomial of degree $n$ has at most $n$ zeros. They do this by using division algorithm and induction.
Then they make the following remark:
This is not true for polynomial over arbitrary rings. For instance $x^2 + 7 \in \mathbb{Z}_8$ has roots $1,3,5,$ and $7$.
My question: what fails in the previous proof for arbitrary rings? They just made that remark and moved on.
Edit -- Proof (from Gallian):
We proceed by induction on $n$. Clearly, a polynomial of degree $0$ over a field has no zeros. Now suppose that $f(x)$ is a polynomial of degree $n$ over a field and $a$ is a zero of $f(x)$ of multiplicity $k$. Then, $f(x)=(x-a)^kq(x)$ and $q(a) \neq 0$. Note we have $\text{deg }f = n = k + \text{deg }q$. If $f(x)$ has no zeros other than $a$, we are done. On the other hand, if $b \neq a$ and $b$ is a zero of $f(x)$, then $0=f(b)=(b-a)^kq(b)$ so that $b$ is a zero for $q(x)$ with the same multiplicity it has for $f(x)$. By the Second Principle of Mathematical Induction, we know that $q(x)$ has at most deg $q(x)=n-k$ zeros, counting multiplicity. Thus, $f(x)$ has at most $k + n -k = n$ zeros, counting multiplicity.