I was trying to prove that $\mathbb{Z}[x]$ is noetherian, so every ideal in $\mathbb{Z}[x]$ is finitely generated.
I feel that all ideals in $\mathbb{Z}[x]$ are essentially generated by two elements - a polynomial and the smallest integer belonging to the ideal.
Let $a(x) \in I$, where $I$ is an ideal in $\mathbb{Z}[x]$, be a polynomial whose degree is the least. Let $b(x)$ be another polynomial whose degree is more than $a(x)$ then $r(x)=a(x)-b(x)q(x) \in I$ becomes the polynomial of the smallest degree (we first assume that $r(x)$ is a non constant polynomial). So $r(x)$ has to be zero.
If $r(x)$ is a constant in $\mathbb{Z}$ and let $r $ be the least positive integer in $\mathbb{Z}[x]$. If $r(x) \in (r)$ then we are done, or let $d=(r(x),r)$ then I will be generated by $(a(x),d)$. What I think is that I am going wrong in the last paragraph. Can someone point out my mistake.
As Angina Seng pointed out, your mistake is that you think you can do polynomial division as if you were working over a field. You cannot reduce $a(x)$ modulo $b(x)$ and expect a low degree remainder. If the leading coefficient of $a(x)$ is not divisible by that of $b(x)$ you are dismounted at the first obstacle: what choice of $q(x)$ would give a low degree $r(x)$ when for example $$ r(x)=(4x^5+7)-q(x)(3x^3+5)? $$ You see what the problem is? The leading coefficient of the product $q(x)(3x^3+5)$ will be divisible by three, and hence cannot be equal to four, which is what you would need to cancel the term $4x^5$.
You can (and arguably should) use a general proof of Hilbert basis theorem. The following minor shortcut is available in $\Bbb{Z}[x]$. Leaving the steps as exercises :-)
Let $I$ be a non-zero ideal of $\Bbb{Z}[x]$.