Proving measurable function: Real versus rational number [duplicate]
Solution 1:
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:
Let $A$ be a dense subset of $\mathbb R$. Then $f$ is measurable if $\{x : f(x) > a\}$ is measurable for all $a \in A$.
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\}.$$
Solution 2:
Hint:
For $a\in\mathbb R$ let $(r_n)_n$ be a decreasing sequence in $\mathbb Q$ converging to $a$.
Try to express $\{x\mid f(x)>a\}$ in the sets $\{x\mid f(x)>r_n\}$.
Solution 3:
I am posting this solution that was spun out of solutions from @RobertCardona and @drhab , thanks to both of you for patiently fielding my clueless-at-best, dumb-at-worst questions.
(1) Let $a \in \mathbb R$ such that $\{x \mid f(x) > a \} \in \mathcal A$. Thus $f(x)$ is a measurable function.
(2) $\forall a \in \mathbb R$, there exists a sequence {$r_k$}, $r_k \in \mathbb Q$ and $k \in \mathbb N$, such that $r_k$ converges to $a$. That is,
$$\lim_{k \to \infty} r_k = a.$$
(3) Observe that $\{x \mid f(x) > a \}$ can be expressed in term of many, many $ \{x \mid f(x) > r_k\}$. Thus,
$$\{x \mid f(x) > a \} = \bigcup _{k=1}^{\infty} \{x \mid f(x) > r_k\}.$$
(4) Recall that $\{x \mid f(x) > r_k\} \in \mathcal A$ by hypothesis. Since union of measurable sets is also measurable, therefore
$$\bigcup _{k=1}^{\infty} \{x \mid f(x) > r_k\} \in \mathcal A,$$
where $r_k$ is rational number.
(5) Since the $f(x)$ in the RHS of equation (3) is a measurable function, thus it's implied that the $f(x)$ in the LHS is also measurable function for $r \in \mathbb Q.$ $\qquad \blacksquare$