Does Factor Theorem fail for non-fields? I would like to solve the following:

By the Factor theorem a polynomial $f ∈ R[x]$, for $R$ is a field, then has a root in $R$ if and only if $(x-a)$ factor. Is the same statement necessarily true for $R[x]$ if $R$ is not a field? If not, provide a counter-example.

I know that the factor theorem is failed if $R$ is a non-commutative ring. So I was thing of the Quaternion. But I cannot figure out a counter-example.
 A: Suppose $R$ is a commutative ring. 

$f\in R[X]$ has a root $a\in R$ iff $X-a\mid f$.

If $X-a\mid f$ then $f=(X-a)g$ for some $g\in R[X]$, so $f(a)=0$.
For the converse, it's easily seen that $X-a\mid f(X)-f(a)$. Since $f(a)=0\implies X-a\mid f$, and you are done.
A: The problems that occur, when $R$ is non-commutative come from the fact that in the polynomial ring $R[x]$ the variable $x$ commutes with all the elements of $R$ (when viewed as constant polynomials), but when you plug in an element that does not commute with the coefficients of the polynomial you get surprises.
For example in the ring of Hamilton's quaternions $\Bbb{H}$ funny things like the following happen. The product of polynomials is
$$
f(x)=(x-j)(x-i)=x^2-(j+i)x+ji=x^2-(j+i)x-k,
$$
but here
$$
f(j)=j^2-j^2-ij+ji=-2k\neq0.
$$
A reason for this problem is that the mapping $e$ of evaluating a polynomial at $q\in\Bbb{H}$, $e:f(x)\mapsto f(q)$,
is NOT a homomorphism of rings from $\Bbb{H}[x]$ to $\Bbb{H}$.
Arturo Magidin elaborated on this here.
