Polynomial ideals I got stuck with an exercise while preparing for my exam, and could use a hint or two to move on...
Let $f(X) = a_n X^n+a_{n-1} X^{n-1}+ \cdots +a_0 \in \mathbb{Z}[X]$ with $a_0\neq 0$
Assuming that $X\in \langle f(X)\rangle$ then prove: $n \leq 1$ and either $\langle f(X)\rangle = \langle X\rangle$ or $f(X) = \mathbb{Z}[X]$
I have shown that if $5 \in \langle f(X)\rangle$ then $n = 0 $ and $a_0\mid 5$, and got to at point where I have:
$$X\in \langle f(X)\rangle \Rightarrow X = \lambda f(x), \quad \lambda \in \mathbb{Z}[X]$$
Which tells me that $\deg(f(x))$ is either one or zero.
If it is $0$ then $f(X)$ is a unit
If $\deg(f(X))$ is 1 then $f(X)$ is irreducible and $\langle f(X)\rangle$ is a maximal ideal

$X=f(X)g(X) \Rightarrow deg f(X) + deg g(X)=1 \Rightarrow deg f(X)=0,1.$ If $deg f(X)=0,$ then $f(X)$ is a constant. Say $f(X)=\lambda \in \mathbb Z.$ In this case equating the coefficient of $X$ from both side we get that $\lambda$ is actually a unit. (This part you got right.) Now let $f(X)=aX+b, a \neq 0.$ Since $X \in \langle f(X) \rangle,$ we must have $a$ is a unit and $b=0.$ (Why?) Thus $\langle f(X) \rangle = \langle X \rangle.$
