1. ## measurable function

Prove that if f is a real function on a measurable space X such that {x:f(x) is greater than or equal to r} is measurable for every rational r, then f is measurable.

I am pretty certain I have to use the density of the rationals, but I don't see how.

2. Originally Posted by robeuler
Prove that if f is a real function on a measurable space X such that {x:f(x) is greater than or equal to r} is measurable for every rational r, then f is measurable.

I am pretty certain I have to use the density of the rationals, but I don't see how.
If $\{x\,:\, f(x) \geq r\}$ is measurable for every $r\in \mathbb{Q}$, it follows that $\{x\,:\, f(x) > s\}=\bigcup_{r\in \mathbb{Q}, r>s}\{x\,:\, f(x)\geq r\}$ is measurable for every $s\in \mathbb{R}$, because a countable union of measurable sets is measurable.