It was proved by Birget, Margolis, Meakin and Weil that deciding whether a finitely generated subgroup $H$ of a free group is pure (meaning $H$ is closed under taking roots) is PSPACE-complete using semigroup theory. 

The main idea is that to each Stallings graph of a finitely generated subgroup of a free group, you can associate a finite inverse semigroup given by generators.  They proved that the subgroup is pure if and only if the inverse semigroup is aperiodic (meaning any subsemigroup which is a group is a trivial group).  This can be checked in PSPACE.  Then, they modified a classical construction in automata and finite semigroup theory showing that it is PSPACE-complete to decide if an automaton has an aperiodic transition semigroup, to prove completeness for purity.