Is $X$ irreducible in $R[X]$? Suppose we are working with a commutative ring $R$. I am reading a proof where the author writes 
"If we are in $R[X]$ and we know that $f\mid X$. Thus either $f$ is a unit multiple of $X$ or it is a unit, so $(f)=(X)$ or $(f)=(1)$."
This seems to assume that $X$ is irreducible in $R[X]$. However I don't know how we would prove this unless we assume $R$ is an integral domain. Solving by hand$$(a_0+a_1X+\cdots+a_nX^n)(b_0+b_1X+\cdots+b_mX^m)=X$$ does not seem to require that one of these polynomials is a unit. Am I missing something here?
 A: Let me summarize and give another answer, which the question has deserved.


*

*Yes, this is correct. The claim does not follow unless we assume that $R$ is an integral domain. We can easily give examples, where $R$ is a commutative ring with zero divisors, and the claim is false. Let $n=ab$ be a composite number and take $R=\mathbb{Z}/n\mathbb{Z}$. Then $a,b$ are zero divisors in $R$, and we have
$$
(ax+b)(bx+a)=(a^2+b^2)x.
$$
If we can choose $a,b$ such that $a^2+b^2=1$ in $R$, then we obtain a counterexample. For example, take $(a,b)=(3,4)$ with $n=12$, or $(a,b)=(2,3)$ with $n=6$ (see the comment).

*If $R$ is an integral domain, we have $\deg(fg)= \deg(f)+\deg(g)$ for $f,g\neq 0$. Then $x$ is irreducible.
A: In fact, one can prove the following theorem:
Thm. Let $A$ be a commutative ring with 1. Then $X$ is irreducible in $A[X]$ if and only if $A$ has no nontrivial idempotent elements (nontrivial meaning: different from $0$ and $1$)
Proof. I will prove in fact that $X$ is reducible if and only if $A$ has a nontrivial idempotent.
Assume that $e\in A$ is an idempotent different from $0$ and $1$. Then the polynomials $(1-e)X+e$ and $eX+(1-e)$ are nonzero, non invertible (otherwise their constant terms would be invertible, which would imply that $e=0$ or $1$, since $e(1-e)=0$). However, $((1-e)X+e)(eX+(1-e))=X$, so $X$ is 
reducible.
Assume now  that $X$ is reducible. Notice that it is nonzero, and non invertible (since its constant term is not invertible). Hence  $X=RS,$ where $R$ and $S$ are not invertible
Write $R=a+XP,S=b+XQ.$ We then have $X=ab+(aQ+bP)X+X^2PQ$.
Evaluation at $0$ yields $ab=0$. Therefore $X=(aQ+bP)X+X^2PQ$. Sicne multiplication by $X$ is  injective, we get $$1=aQ+bP+XPQ.$$ Set $v=P(0)$ et $u=Q(0)$.  Evaluation at $0$ yields $au+bv=1$.
Set $e=au$. We have $$e^2=au (1-bv)=au-abuv=au=e,$$
hence $e$ is an idempotent.Assume that $e=0$. Then, $bv=1$, so $b$ is invertible and consequently $a=0.$
We then have $X=XPS$. Since multiplication by $X$ isinjective, we obtain $1=PS$, so $S$ is invertible, contradiction. Hence, $e\neq 0$.
Similarly if $e=1$, then $au=1$ and we obtain this time that $R$ is invertible. Conclusion: $e$ is a nontrivial idempotent of $A$.
