By the theorem and unique factorization in $\mathbb{F}_p[X]$, the factorization of $g(X)=X^{p^n}-X$ into irreducible polynomials must have the form $$g(X)=cf_1(X)^{e_1}f_2(X)^{e_2}\dots f_m(X)^{e_m}$$ where $c$ is a constant, $f_1,\dots f_m$ are all of the irreducible monic polynomials of degree dividing $n$, and $e_1,e_2,\dots,e_m$ are all at least $1$. Since $g(X)$ is monic, we must have $c=1$, so we just need to show $e_i=1$ for each $i$. That is, we want to show $g(X)$ has no repeated irreducible factors.
A common trick to understand whether a polynomial has repeated factors is to consider its derivative. Note that the derivative of $g(X)$ is $$g'(X)=p^nX^{p^n-1}+1=1.$$ If $e_i>1$ for some $i$, then $f_i(X)$ would divide $g'(X)$ (since when you differentiate the factorization of $g(X)$ using the product rule, every term will include a factor of $f_i(X)$). This is impossible, since $f_i(X)$ is not a unit. Thus we must have $e_i=1$ for all $i$, as desired.