Theorem 6.19 of Baby Rudin 
Suppose $\varphi$ is a strictly increasing continuous function that maps an interval $[ A, B]$ onto $[ a, b]$. Suppose $\alpha$ is monotonically increasing on $[ a, b]$ and $f \in \mathscr{R}(\alpha)$ on $[a, b]$. Define $\beta$ and $g$ on $[ A, B]$ by
$$ \beta(y) = \alpha \left( \varphi(y) \right), \qquad g(y) = f \left( \varphi(y) \right). \tag{36} $$
Then $g \in \mathscr{R}(\beta)$ and
$$ \int_A^B g \ \mathrm{d} \beta =  \int_a^b f \ \mathrm{d} \alpha. \tag{37} $$

Rudin’s proof:

To each partition $P = \{ \ x_0, \ldots, x_n \ \}$ of $[a, b]$ corresponds a partition $Q = \{ \ y_0, \ldots, y_n \ \}$ of $[ A, B]$, so that $x_i = \varphi \left( y_i \right)$. All partitions of $[A, B]$ are obtained in this way. Since the values taken by $f$ on $\left[ x_{i-1}, x_i \right]$ are exactly the same as those taken by $g$ on $\left[ y_{i-1}, y_i \right]$, we see that
$$ \tag{38} U(Q, g, \beta) = U(P, f, \alpha), \qquad L(Q, g, \beta) = L(P, f, \alpha). $$
Since $f \in \mathscr{R}(\alpha)$, $P$ can be chosen so that both $U(P, f, \alpha)$ and $L(P, f, \alpha)$ are close to $\int f \ \mathrm{d} \alpha$. Hence (38), combined with Theorem 6.6, shows that $g \in \mathscr{R}(\beta)$ and that (37) holds. This completes the proof.

Question I don’t understand the last step, especially (37) holds: Hence (38), combined with Theorem 6.6, shows that $g \in \mathscr{R}(\beta)$ and that (37) holds.
 A: As $f\in\mathscr{R}(\alpha)$, by Theorem 6.6 there exists a partition $P$ consisting of $x_i\in[a,b]$ such that
$$U(P,f,\alpha)-L(P,f,\alpha) < \epsilon\ . $$
But $Q$ defined by the values $\varphi(y_i)=x_i$ is a partition of $[A,B]$ and by the equality (38) we have
$$U(Q,g,\beta)-L(Q,g,\beta) < \epsilon\ .$$
Thus by the other direction of Theorem 6.6 we have that $g\in\mathscr{R}(\beta)$.
To see that they are equal, you just need to see that
$$\sup_{P}L(P,f,\alpha) = \sup_Q L(Q,g,\beta)\ .$$
Let $P=\{x_i\}$ be a partition of $[a,b]$ and define $Q=\{\varphi^{-1}(x_i)\}$. This is a partition of $[A,B]$ so we have
$$ L(P,f,\alpha) = L(Q,g,\beta)\leq \sup_{Q}L(Q,g,\beta)\ .$$
Now we take the $\sup$ over all such $P$ to see
$$\sup_{P}L(P,f,\alpha) \leq \sup_Q L(Q,g,\beta)\ .$$
Conversely, suppose $Q=\{y_i\}$ is a partition of $[A,B]$ and we can define $P=\{\varphi(y_i)\}$ which is a partition of $[a,b]$. Then we have
$$L(Q,g,\beta)=L(P,f,\alpha)\leq \sup_{P} L(P,f,\alpha)\ .$$
Taking $\sup$ over all such $Q$ gives
$$\sup_{Q}L(Q,g,\beta) \leq \sup_P L(P,f,\alpha)\ .$$
A: Theorem 6.6 says the following:
$f \in \mathscr{R}(\alpha)$ if and only if for every $\epsilon > 0$ there exists a partition $P$ such that
$$U(P,f,\alpha) - L(P,f,\alpha) < \epsilon.$$
Put another way: $f$ is integrable iff you can make the upper and lower Reimann sums arbitrarily close by choosing the right partition. This is what he's referring to when he says that $U$ and $L$ can be made close to $\int f d\alpha$. The fact that partitions on $[A, B]$ can be identified with partitions on $[a, b]$, and that the associated Reimann sums are equal, is what ties the fates of $f$ and $g$ together. All of the information about integrability is captured in the partitions and associated Reimann sums.
