I need to prove this:
Let $I\subset\mathbb{Z}$ be the ideal generated by $\{p,f(x)\}$, with $p$ prime in $\mathbb{Z}$. Then $I$ is maximal iff $f(x)$ is irreducible modulo $p$.
So I was trying to prove that if $f(x)$ is not irreducible modulo $p$ then $I$ is not maximal by taking the ideal generated by $\{p,g(x)\}$ where $g(x)$ divides $f(x)$ modulo $p$. And for the other part I was trying to prove that $\mathbb{Z}[x]/I$ is a field, but it didn't go so well.
As you say, if $I$ was maximal then $f$ must be irreducible. Conversely, notice that $\mathbb{Z}[x]/(p,f(x))\cong\mathbb{Z}_p[x]/(f(x))$. If you know something about finite fields, you will be done. If you don't, then argue as follows: Since $f$ is irreducible, every non-zero element of the quotient comes from an element $g\in\mathbb{Z}_p[x]$ that is coprime to $f$. By the euclidean algorithm we can find $a,b\in\mathbb{Z}_p[x]$ such that $fa+gb=1$. Looking at this equality in the quotient gives us an inverse for $g$ i.e. we have a field.