Example A-3.50: Let $R=\mathbb{Z}[x]$, the commutative ring of all polynomials over $\mathbb{Z}$. It is easy to see that the set $I$ of all polynomials with even constant term is an ideal in $\mathbb{Z}[x]$. We show that $I$ is not a principal ideal.
Suppose there is $d(x) \in \mathbb{Z}[x]$ with $I=(d)$. The constant $2 \in I$, so that there is $f(x) \in \mathbb{Z}[x]$ with $2 = df$. Since the degree of a product is the sum of the degrees of the factors, $0 = \deg(2) = \deg(d) + \deg(f)$. Since degrees are nonnegative, it follows that $\deg(d) = 0$ (i.e., $d(x)$ is a nonzero constant). As constants here are integers, the candidates for $d$ are $\pm1$ and $\pm2$. Suppose $d=\pm2$; since $x \in I$, there is $g(x) \in \mathbb{Z}[x]$ with $x = dg = \pm2g$. But every coefficient on the right side is even, while the coefficient of $x$ on the left side is $1$. This contradiction gives $d = \pm1$. By Example A-3.31, $I= \mathbb{Z}[x]$, another contradiction. Therefore, no such $d(x)$ exists; that is, $I$ is not a principal ideal.
Question: This is an example in "Modern Algebra - J. J. Rotman". I want to ask "As constants here are integers, the candidates for $d$ are $\pm1$ and $\pm2$." From $2 = df \Rightarrow 0 = \deg(d) + \deg(f) \Rightarrow \deg(d) = 0 = \deg(f)$, why he concluded the candidates for $d$ are $\pm1$ and $\pm2$?