Let $K$ be a field with $\operatorname{char}(K) = p > 0$ and let $L = K[X]/(f)$ for some irreducible polynomial $f \in K[X]$. We know that there is a separable polynomial $q_{sep}\in K[X]$ such that $q_{sep}(X^{p^n}) = f(X)$ for some $n\in \mathbb{N}$. Lastly let $\phi:K[X]/(q_{sep}) \to L$ be the $K$-homomorphism with $\phi(X) = X^{p^n}$. I have to show that $\text{im}(\phi) \cong K_s$ where $K_s$ is the separable closure of the extension $L/K$.
Note that $\phi$ was made using the isomorphism theorem and so I know that $K[X]/(q_{sep}) \cong \text{im}(\phi)$
To show that $\text{im}(\phi)\subseteq K_s$ I showed that $K\subseteq K[X]/(q_{sep})$ is a separable algebraic extension. Then it follows that $K\subseteq \text{im}(\phi)$ is a separable algebraic extension and therefore $\text{im}(\phi) \subseteq K_s$.
But now I'm stuck trying to prove the other inclusion.
I know that if I can show that $[K_s:\text{im}(\phi)] =1$, $[K_s:K] = \deg(q_{sep})$ or $[L:K_s] = p^n$ then I have proven that they have the same dimension over K and thus are equal. But I don't know how to continue from here. I could show that $[K_s:\text{im}(\phi)] =1$ by showing that there is only 1 homomorphism from $K_s$ to an algebraic closure that is the identiy on $\text{im}(\phi)$. But I also don't know how to continue from here.
Because $\text{im}(\phi) \subseteq K_s$ is a finite separable extension I know that there is a primitive element $\alpha \in K_s$ such that $K_s = \text{im}(\phi)(\alpha)$. Now I would have to show that $\alpha \in \text{im}(\phi)$. But I'm again stuck here.
All of these seem promising. But it always leads back to showing that a separable polynomial of $K[X]/(f)$ is also in the image of $\phi$.
Could you please give me a hint on how to prove this?
As you said, we start by noting that $\operatorname{im}(\phi)/K$ is a separable subextension of $L/K$. The next thing we have to show is that $L/\operatorname{im}(\phi)$ is purely inseparable.
But notice that $L = \operatorname{im}(\phi)(X)$ is produced by adjoining a $p^n$th root of $X^{p^n}$ to $\operatorname{im}(\phi)$. This sort of extension is always purely inseparable (see here for a proof).