In this book, section 11.1.1 on sampling methods (rejection sampling) we generate $z$ from a uniform distribution on $[0, 1]$ and then transform $z$ using a function $f$ so that $$y=f(z).$$
The distribution of $y$ is then: $$p(y) = p(z) \, \bigg\lvert\frac{dz}{dy}\bigg\rvert \tag{1}$$
and in this case $p(z) = 1$. It is then stated that by integrating equation $(1)$ we obtain:
$$ z = h(y) \equiv \int_{-\infty}^{y}p(\hat{y}) \, d\hat{y} \tag{2}$$
which is the indefinite integral of $p(y)$ and thus $y=h^{-1}(z)$.
My question is simply how the limits in $(2)$ integral come about (and surely they must have been applied to both sides)?
Thanks in advance.
Edit: It's probably worth pointing out that $h$ is now the CDF of $p(y)$.