Why is a polynomial of form $g(X^{p^m})$ over a field of characteristic $p$ not necessarily inseparable? A small proposition in Ash's Algebra states that over a field $F$ of prime characteristic $p$, an irreducible polynomial $f$ is inseparable if and only if $f'$ is the zero polynomial, or equivalently, $f$ is a polynomial in $X^p$. 
A later exercise asks the following. Let $f$ be an irreducible polynomial in $F[X]$ where $F$ has characteristic $p\gt 0$. Express $f(X)$ as $g(X^{p^m})$ where the nonnegative interger $m$ is as large as possible. Show that $g$ is irreducible and separable.
I get that $g$ is irreducible, since $f$ is. But if $g$ is a polynomial in $X^{p^m}$ I can write it as
$$
g=a_0+a_1X^{p^m}+a_2(X^{p^m})^2+\cdots+a_n(X^{p^m})^n
$$
so
$$
g'=p^ma_1X^{p^m-1}+2p^ma_2X^{2p^m-1}+\cdots+np^ma_nX^{np^m-1}.
$$
But then each coefficient is divisible by $p$, so isn't $g'$ identically $0$, meaning $g$ is inseparable by the proposition stated above? The provided solution states that since $m$ is maximal $g\notin F[X^p]$, (which I don't quite get, why can't $m=1$?), and so $g$ is separable, contrary to what I say. What have I done wrong here? Thanks. 
 A: I think you are confusing $f$ and $g$. It is $f$ that is a polynomial in $X^p$. For example, if you were working in a field of characteristic $3$, you could have
$$f(x) = 1 + 2x^3 -x^6 + x^9.$$
To express it as a polynomial in $x^3$, you would write
$$f(x) = 1 + 2(x^3)^1 - (x^3)^2 + (x^3)^3$$
so the polynomial $g(u)$ would be
$$g(u) = 1 + 2u - u^2 + u^3,$$
which, when evaluated at $x^3$, gives $f(x)$. That is, $f(x)=g(x^3)$. But notice that $g(x) = 1+2x - x^2 + x^3$ is in fact separable.
So your $g(x)$ above should be
$$g(x) = a_0 + a_1X + a_2x^2 + \cdots + a_nx^n.$$
(As written, $g(x)$ itself can be expressed as $h(x^{p^m})$, where $h(x)$ is the polynomial I have just written, so if $f(x) = g(x^{p^n})$, then in fact $f(x) = h(x^{p^{n+m}})$ and you would use $h(x)$, not $g(x)$).
A: $g$ is the polynomial in $X$, such that when $X^{p^m}$ is substituted in for $X$, we get $f$, i.e. $g(X^{p^m})=f(X)$. 
Let $$f(X)=a_0+a_1X^{d_1}+\cdots+a_nX^{d_n}$$ for some $d_i\in\mathbb{N}$. Suppose $d_i=e_ip^{m+1}$ for all $i$. Then 
$$g(X)=a_0+a_1X^{e_1p}+\cdots+a_nX^{e_np}$$ is the polynomial such that
$$g(X^{p^m})=a_0+a_1(X^{p^m})^{e_1p}+\cdots+a_n(X^{p^m})^{e_np}=$$
$$a_0+a_1X^{e_1p^{m+1}}+\cdots+a_nX^{e_np^{m+1}}=a_0+a_1X^{d_1}+\cdots+a_nX^{d_n}=f(X).$$
However, we can let $h(X)=a_0+a_1X^{e_1}+\cdots+a_nX^{e_n}$. In other words, $h$ is the polynomial (in $X$) such that $h(X^p)=g(X)$. We will have
$$f(X)=g(X^{p^m})=h(X^{p^{m+1}}),$$
which contradicts the maximality of $m$.
