Consider the field $K=\mathbb{F}_p(T)$ for a prime number $p$ and the polynomial $f=X^{p^2}-TX^p-T\in K[X]$.
I think that $f$ is irreducible in $K[X]$ but not seperable. This means, that there are less than $p^2$ distinct roots of $f$ in $\overline{\mathbb{F}_p(T)}$. My question now is:
$\textbf{How can I decide exactly how many distinct roots $f$ has in $\overline{\mathbb{F}_p(T)}$?}$
I tried substituting $Y=X^p$ but this gives me two roots $X_{1,2}=0$ which cannot be true...
As mentioned in comments, for $Y := X^p$ we have
$$f= Y^p-TY-T.$$
This is a separable polynomial (in $Y$, over $\mathbb F_p(T)$), let its (distinct!) roots be $y_1, ..., y_p \in \overline{\mathbb F_p(T)}$.
For each $y_i \in \overline{\mathbb F_p(T)}$ there is a unique $\eta_i \in \overline{\mathbb F_p(T)}$ such that $\eta_i^p =y_i$. Consequently, in $\overline{\mathbb F_p(T)}$, we have the factorization
$$f(X) = \prod_{i=1}^p (X^p-\eta_i^p) = \prod_{i=1}^p (X-\eta_i)^p . $$
In other words, the roots of $f$ are the $\eta_i$, each of them with multiplicity $p$, giving a total numebr of roots (with multiplicities) of $p^2$.
Note that in a way, here I am making a tower of fields $\mathbb F_p(T) =: K \subset K(y_1, \dots, y_p) \subset K(\eta_1, \dots, \eta_p)$ where the bottom extension is separable and the top is purely inseparable. The other answer first puts the purely inseparable $E:=K(\sqrt[p]{T})$ on top of $K$, and then constructs a separable extension of $E$ with its polynomial $g \in E[X]$.