Here is a geometric (schemes!) way to think about it.

The inclusion $\Bbb Z\to\Bbb Z[x]$ defines a morphism $\operatorname{Spec}(\Bbb Z[x])\to\operatorname{Spec}(\Bbb Z).$ Thus to figure out the primes of $\operatorname{Spec}(\Bbb Z[x]),$ we can simply determine all the fibres of this map. How do we compute the fibres of this map?

For $\langle p\rangle\subseteq\Bbb Z$ a prime ideal, we pull back the morphism given above over the map $\operatorname{Spec}(\kappa(p))\to\operatorname{Spec}(\Bbb Z)$ induced by $\Bbb Z\to\Bbb Z_p/\frak{m_p}$ $=\kappa(p)$, where $\kappa(p)$ is the residue field of $p.$ The residue field $\kappa(0)=\Bbb Q$ and for all other primes $p$ we have $\kappa(p)=\Bbb F_p.$

The fibre over $\langle 0\rangle$ is thus $\operatorname{Spec}(\Bbb Q\otimes_{\Bbb Z}\Bbb Z[x])=\operatorname{Spec}(\Bbb Q[x])$ which is all irreducible polynomials over $\Bbb Q$ and the zero ideal. Similarly, the fibre over $\langle p\rangle$ is $\operatorname{Spec}(\Bbb F_p[x]),$ which is just the irreducible polynomials over $\Bbb F_p$ along with its zero ideal. (The zero ideals correspond to those in $\Bbb Z.$)


The prime ideals of $\mathbb Z[x]$ are of three kinds depending on their heights

  1. (height $0$): $\{ 0\}$;

  2. (height $1$): $F(x)\mathbb Z[x]$ with $F(x)$ an irreducible element in $\mathbb Z[x]$. Equivalently: $F(x)$ is a prime number $p$ or is primitive and irreducible in $\mathbb Q[x]$.

  3. (height $2$, maximal ideals): the $(p, f(x))$ as you describe.


The intersection of a prime ideal with $\mathbb Z$ is again prime, thus we obtain a prime $p$ (or 0). By localizing at $p$, we make all non-multiples of $p$ invertible and are left with an ideal in the principle ideal ring $\mathbb Z_p[X]$, i.e. $(f)$ with $f\in\mathbb Z_p[X]$. If we had a nontrivial factorization $f\equiv gh\pmod p$, this could be lifted to a factorization in $\mathbb Z_p[X]$, which is impossible. Hence $f$ is irreducible $\bmod p$. This also holds if we replace $f$ with an approximation in $\mathbb Z[X]$. We also see that any $g$ in the ideal becomes a multiple of $f$ in $\mathbb Z_p[X]$, hence can be written as a multiple of $p$ plus a multiple of $f$ in $\mathbb Z[X]$.


There is a sketch here but I didn't proofread it. I am gambling that it is useful, so I apologize (and will delete this) if it turns out to be useless.