Suppose the density of $X$ can be written as $f(x) = cg(x)\bar{H}(x)$, where $g$ is the density of a r.v. $Y$ and $\bar{H}(x) = \mathbb{P}(Z > x)$ the survival function of a r.v. $Z$.
To show: $X$ can be generated by sampling pairs $(Y , Z)$ independently and rejecting until $Y \leq Z$. Hint: Compute $\mathbb{P}(x < Y \leq Z)$ by conditioning on $Y$.
Attempt: Not much, I tried to do the hint, but I don't know why I need it and I 'm not sure if this is correct. I have $$ \mathbb{P}(x < Y \leq Z | Y = y) = \bar{H}(y)\mathbb{1}_{y > x} $$ and so $$ \mathbb{P}(x < Y \leq Z) = \int \bar{H}(y)\mathbb{1}_{y > x}g(y)dy = \int_x^{\infty} \bar{H}(y)g(y)dy. $$
I was wondering anyone can help me out on what to do next. Thanks in advance!
Additional attempt: Thanks to the hint in the comment, I can advance a bit but I'm still stuck.
So $ \mathbb{P}(x < Y \leq Z) = \frac{1}{c}\mathbb{P}(x \leq X)$, which is the probability of accepting. Now,
$$ \mathbb{P}(x \leq X | x < Y \leq Z) = \frac{\mathbb{P}(x < Y \leq Z | x \leq X)\mathbb{P}(x \leq X)}{\mathbb{P}(x < Y \leq Z)} = c\mathbb{P}(x < Y \leq Z | x \leq X). $$ But what is $\mathbb{P}(x < Y \leq Z | x \leq X)$?