Why is $(3,x^3-x^2+2x-1)$ not principal in $\mathbb{Z}[x]$? I have a small hitch in showing $(3,x^3-x^2+2x-1)$ is not principal in $\mathbb{Z}[x]$. Towards the contrary, I suppose $(3,x^3-x^2+2x-1):=(3,f)=(g)$ is principal. Then $3\in (g)$, so $3=gh$ for some $g,h\in\mathbb{Z}[x]$. Thus $g,h$ must be constant, and $g\mid 3$, so $g=1,3$. But $g$ cannot be $3$, since $f\neq 3p$ for any $p\in\mathbb{Z}[x]$, since the coefficients are not all divisible by $3$.
If $g=1$, then $(3,f)=\mathbb{Z}[x]$. I don't think this is true, but I don't know how to make it rigorous. I tried supposing $1=pf+3r$ where $p,r\in\mathbb{Z}[x]$ to reach a contradiction and show that $1\notin(3,f)$, but I don't how to more formally prove it. What can I do? Thanks.
 A: Say $pf+3r=1$. Divide $r$ by $f$; $r=qf+s$, where $s$ is of degree at most 2. Now $$1=pf+3r=pf+3(qf+s)=(p+3q)f+3s{\rm\qquad so\qquad}(p+3q)f=1-3s$$ The right side has degree at most 2, so the left side has degree at most 2, but the left side is a multiple of $f$, which has degree 3, so the left side is identically zero, so the right side is identically zero, but the constant term on the right side is 1 modulo 3, contradiction. 
A: Another way of viewing this: look at the quotient ring
\[
\mathbf Z[x]/(3) \simeq \mathbf (\mathbf Z/3\mathbf Z)[x],
\]
which is a polynomial ring over a field. Is the image of $f$ in this ring a unit? Is it clear why this settles the question of whether $(3, f)$ is all of $\mathbf Z[x]$?
A: Hint $\rm\,\ fg = 1 + 3h\ \Rightarrow\ mod\ 3\!:\ fg\equiv 1\:\Rightarrow\:deg(fg) = 0\:\Rightarrow\: deg(f) = 0\:$ contra $\rm\: f \equiv x^3 +\:\cdots$
Remark $\ $ The same proof works for $\rm\:3\to m > 1\:$ and any $\rm\:f\:$ both monic and nonconstant mod $\rm\:m.$ Generally over any ring R, a polynomial $\rm\:f\in R[x]\:$ is a unit iff $\rm\,f_0 = f(0)\,$ is a unit in R and all higher coefficients are nilpotent in R, i.e. for all $\rm\:i>0,\,\ f_i^n = 0\:$ for some $\rm\:n\in \Bbb N.$ In particular, if $\rm\:f\in \mathbb Z[x]\:$ has degree $> 1$ and leading coefficient $\rm\:c\:$ coprime to $\rm\:m>1\:$ then in $\rm\:R = \Bbb Z/m\:$ the leading coefficient of $\rm\:f\:$ becomes a unit, so $\rm\:f\:$ remains a nonunit over R (as the hint shows more simply).
