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?
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.