Let $\mathbb{K}=\mathbb{F}_{p^d}$ and $f\in\mathbb{K}[X]$ be a non-constant polynomial with the factorization $$f=\prod_{i=1}^nf_i^{k_i}$$ where $f_i\in\mathbb{K}[X]$ is irreducible and $k_i\in\mathbb{N}$. Moreover, let $I:=\left\{i:p\nmid k_i\right\}$.
- What can we say about $$g:=\frac{f}{\gcd(f,f')}$$
- How do we show $$\frac{f}{\gcd(f,g^k)}=\prod_{i\notin I}f_i^{k_i}$$ for some $k\ge k_i$ for all $i\in I$?
- What's the square-free part of $f$? May it be $g$?
With the given facts, it's easy to see that $$f'=\left(\prod_{i\in I}f_i^{k_i-1}\right)\sum_{i\in I}k_if_i'\prod_{j\in I\setminus{i}}f_j$$
How do we proceed for (1) and (2)?
Write $f=f_i^{k_i}h_i$ with $f_i\nmid h_i$ to determine the highest power of $f_i$ in $f'$s factorization. You will have to use the product rule to expand $f'$, and the answer will depend on whether or not $p\mid k_i$. Once you know the highest power of the $f_i$s appearing in $f'$s factorization, you will know $\gcd(f,f')$ and hence $g$. Once you see what $g$ is, you will be able to tell what $f/\gcd(f,g^k)$ is.