Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Let $X$ be a finite symmetric generating set for $G$ and let $\phi:X^* \to G$ be the canonical homomorphism. Let $w$ be in $(f)\phi^{-1}$. Now, $u$ is in $(M)\phi^{-1}$ exactly if $u^{-1}wu$ is in $H$ which we can check because $H$ is RE.