I am working on this problem$^{(1)}$ on measurable function like this:
Show that $f$ is measurable if $(X, \mathcal A)$ is measurable space, $f$ is real-value function and $\{x \mid f(x) > r \} \in \mathcal A$ for each rational number $r.$
Earlier on the text gives this definition$^{{2}}$ of measurable function:
A function $f : X \to \mathbb R$ is measurable or $\mathcal A$-measurable if $\{x \mid f(x) > a \} \in \mathcal A$ for all $a \in \mathbb R.$
To an untrained eyes, the problem with this problem is that there seems to be no problem at all, except, perhaps, that the exercise says "$\forall r \in \mathbb Q$", whereas the definition says "$\forall a \in \mathbb R.$" Am I on the right track here? Please help me going forward if this is the right issue to tackle.
Thank you for your time and help.
Footnotes:
(1) Richard F. Bass' Real Analysis, 2nd. edition, chapter 5: Measurable Functions, Exercise 5.1, page 44.
(2) Definition 5.1, page 37.
The exercise is assuming that $\{x : f(x) > r\} \in \mathcal A$ for each rational $r$.
You now need to show that it holds for all $a \in \mathbb R$, not just the rationals, for it to satisfy the definition of measurable function.
You are on the right track.
As another exercise for you: this can be generalized slightly to the following, without much change to the proof:
As an update to your comment, I think the theorem itself you mentioned doesn't help directly, but the proof teaches you the technique you should use in this case.
Pick $a \in \mathbb R$, since $\mathbb Q$ is dense in $\mathbb R$, find a sequence $\{q_k\}$ in $\mathbb Q$ such that $\displaystyle \lim_{k \to \infty} q_k = a$ (from above), then notice that $$\{x : f(x) > a\} = \bigcup \{x : f(x) > q_k\}.$$