Say that string $x$ is a *prefix* of a string $y$ if there exists a string $z$ such that $xz = y$, and say that $x$ is a
proper prefix of $y$ if in addition $x \not= y$. A language is prefix-free if it doesn’t contain a proper
prefix of any of its members.
$$
\text{Prefix-FreeREX} = \{(R) \mid R \text{ is a regular expression and $L(R)$ is prefix-free}\}
$$
I was wondering about how to prove that Prefix-FreeREX is decidable. Also why does a similar approach fail to show that Prefix-FreeCFG is decidable?