Capelli Lemma for polynomials

I have seen this lemma given without proof in some articles (see example here), and I guess it is well known, but I couldn’t find an online reference for a proof.

It states like this:

Let $K$ be a field and $f,g \in K[x]$. Let $\alpha$ be a root of $f$ in the algebraic closure of $K$. Then $f \circ g$ is irreducible over $K$ if and only if $f$ is irreducible over $K$ and $g-\alpha$ is irreducible over $K(\alpha)$.

Can you please give a proof for this?

Solutions Collecting From Web of "Capelli Lemma for polynomials"

Let $\theta$ be a root of $g-\alpha$. From $g(\theta)=\alpha$ we get that $f(g(\theta))=0$. Now all it is a matter of field extensions. Notice that $[K(\theta):K]\le \deg (f\circ g)=\deg f\deg g$, $[K(\theta):K(\alpha)]\le \deg(g-\alpha)$ $=$ $\deg g$ and $[K(\alpha):K]\le\deg f$. Each inequality becomes equality iff the corresponding polynomial is irreducible. But $[K(\theta):K]=[K(\theta):K(\alpha)][K(\alpha):K]$ and then $f\circ g$ is irreducible over $K$ iff $g -\alpha$ is irreducible over $K(\alpha)$ and $f$ is irreducible over $K$.