I have a question regarding the proof of Thm A. I know that f is measurable if the set {x: f(x)<c} for all real value c, is measurable.
I have a hard time understanding(fill in the detail) of how did the set A transforms into a union of the intersection of two sets involving r. My current guess is that we want to use rational number to be a countable union? But why is that? and why is this the intersection of two sets?

Here $A=\{x: f(x)<g(x)+c\}$. Also write $A'=\bigcup_{r\in\Bbb Q}\big[\{x:f(x)<r\}\cap\{x:r-c<g(x)\}\big].$
Now, $y\in A\implies f(y)<g(y)+c$, since between two real numbers we have a rational, there is $r\in\Bbb Q$ such that $f(y)<r<g(y)+c$. So, $y\in A'$.
Conversely if $z\in A'$, then $z\in \{x:f(x)<r_1\}\cap\{x:r_1-c<g(x)\}$ for some $r_1\in\Bbb Q$. That is $f(z)<r_1$ and $r_1-c<g(z)$, adding these we get $f(z)<g(z)+c$. So that $z\in A$.