Solution
= Solution
In one proposal of <rejection sampling>, the probability of both proposing a value in $dx$ and accepting it is
$$
h(x)\,dx\,\frac{f(x)}{Mh(x)}
=\frac1M f(x)\,dx.
$$
Integrating shows that the acceptance probability is $1/M$. Conditional on acceptance, the density of the proposed value is therefore
$$
\frac{f(x)/M}{1/M}=f(x).
$$
Each unsuccessful proposal restarts independently, so the eventual output $Y$ has the same conditional density:
$$
\boxed{Y\sim f}.
$$