Suppose $(X, \mathcal{A})$ is a measurable space, $f$ is a real-valued function, and $\{x:f(x)>r\} \in\mathcal{A}$ for each rational number $r$. 
Suppose $(X, \mathcal{A})$ is a measurable space, $f$ is a real-valued
  function, and $\{x:f(x)>r\} \in\mathcal{A}$ for each rational number $r$. Prove that $f$ is measurable.

This proof is fairly straightforward as it is a density argument. I have already written a proof similar to the approach found here. The linked proof uses a
converging sequence $r_k\searrow a$ and $\cup_{k=1}^\infty\{x:f(x)>r_k\}=\{x:f(x)>a\}$ where $a\in\mathbb{R}$ to show that it is measurable. My question is whether it is necessary to use the union or since we can find
some $r\in\mathbb{Q}$ which is arbitrarily close to $a \text{ and }r>a$ would it not just be $\{x:f(x)>r\}=\{x:f(x)>a\}?$ I may be missing something obvious which is why I'm asking. 
 A: To prove the desired result (holding for any $a \in \Bbb R$), you absolutely need a countable union of superlevel sets $\{f > r\}$(, where $r \in \Bbb Q$).  Nothing more and nothing less!


*

*"nothing more"


*

*$\Bbb Q$ is countable and dense in $\Bbb R$

*A $\sigma$-algebra $\cal A$ is closed under countable union/intersection.

*There's no guarantee that $\cal A$ is closed under arbitrary union.


*"nothing less"


*

*A finite union of superlevel sets $\{f>r\}$ won't work since a finite sequence of rational numbers $(r_n)_n$ won't take you to an irrational number $a$.



To verify that $\{x \mid f(x) > a\}$ is measurable set, OP asks whether finding an rational number $r$ arbitrarily close to $a$ would work.  Let me illustrative my negative response with a specific example.
Example pie
Take $a = \pi$.  Fix $\epsilon = 10^{-4}$ before taking an approximation $r = \color{blue}{3.14159}$ for $\pi \approx \color{blue}{3.14159}2654\dots$
To find out $\{f>\pi\}$, $\{f>\color{blue}{3.14159}\}$ would introduce "undesirable" elements including (but not limited to) those in $\{x \mid \color{blue}{3.14159}1 \le f \le \color{blue}{3.14159}2\}$: such elements $f(y) \le \color{blue}{3.14159}2 < \pi$ shouldn't belong to $\{f>\pi\}$.
Formalized idea
As long as you adopt such approximation of $a$ by an arbitrarily close element $r$, you'll introduce "undesirable" elements $q$ in either $(a,r)$ or $(r,a)$.  Therefore, no single $\{f>r\}$ can give you $\{f>a\}$, not even a finite union $\cup_{k = 1}^n \{f>r_k\} = \left\{f>\min\limits_{k = 1,\dots,n}\{r_k\}\right\}$, where $r_k \in \Bbb Q \forall k$.  You'll need a countable union $\cup_{k=1}^\infty\{x:f(x)>r_k\}=\{x:f(x)>a\}$.
