Factoring an irreducible polynomial over $\mathbb{F}_q$ in $\mathbb{F}_{q^k}$ 
Let $f\in \mathbb{F}_q[X]$ be an irreducible polynomial of degree $n$, and let $k\in \mathbb{N}$. Prove that $f$ factors over $\mathbb{F}_{q^k}[X]$ as a product of irreducible polynomials of degree $\frac{n}{\left (n:k\right )}$, where $\left (n:k\right )=\text{gcd}\left (n,k\right )$.

I tried this: if $\alpha $ is a root of $f$ then $\alpha ^{q^r}$ is also a root of $f$ for every $r\in \mathbb{N}$. Therefore, if I were able to prove that $r=\frac{n}{\left (n:k\right )}$ is the least positive integer such that $\alpha ^{q^r}=\alpha$, then I would be done.
I could prove that $\mathbb{F}_{q^k}\cap \mathbb{F}_{q^n}=\mathbb{F}_{q^{\left (n:k\right )}}$, I do not know if it helps.

It's easy to show that the Galois group of $\mathbb F_{q^k}/\mathbb F_q$ permutes the irreducible factors of $f(X)$ transitively, hence they all have the same degree $r$. Let $g(X)$ be an irreducible factor of $f$ over $\mathbb F_{q^k}$. Let $L/\mathbb F_{q^k}$ be a splitting field for $g$ over $\mathbb F_{q^k}$, and $F$ a splitting field for $f$ over $\mathbb F_q$. By counting degrees and by unicity of finite fields we have $L=\mathbb F_{q^{rk}}$ and $F = \mathbb F_{q^n}$. But now it's easy to see that we can take $L= \mathbb F_{q^k} F$ as a splitting field for $g$. So
$$L =  \mathbb F_{q^k} \mathbb F_{q^n} = \mathbb F_{q^{\mathrm{lcm}(k,n)}} = \mathbb F_{q^{kr}}$$
and $\mathrm{lcm}(k,n) = kr$ implies $r = n/\gcd(n,k)$ by the formula $\mathrm{lcm}(n, k) = nk/\gcd(n,k)$.
