If $a$ is algebraic, then a polynomial $p(x)$ in $\ker(f)$ is irreducible iff it generates $ker(f)$.
For an ideal $I$ in $Q[x]$ containing $\ker(f)$, let $p(x)=\ker(f)$ and $q(x)=I$. Then $p$ is irreducible so $p\in\ker(f)$ and $I=q$. Hence there is $r(x)\in\mathbb{Q}[x]$ such that $p=qr$. How do I use the fact that $p$ is irreducible to show that $q$ or $r$ is a unit so that $I=\mathbb{Q}[x]$ or $\ker(f)$?
$k[X]$ is principal, thus $I_a=\{q\in k[X], q(a)=0\}$ is generated by $u$, $p(a)=0$ implies that $p\in I_a$ thus, $p=qu$, since $p$ is irreductible, $q$ is a unit of $k[X]$; $q\in k$.