Approximation of measurable function by simple functions
This is from Tao Exercise 19.1.3.
Let $\Omega \subseteq \mathbb R^n$ measurable and $f: \Omega \rightarrow \mathbb R$ be measurable. Assume $f \geq 0$ on $\Omega$. Then there exists a sequence $\{f_n: \Omega \rightarrow \mathbb R\}_{n=1}^\infty$ s.t. all $f_n$ are simple, non-negative and increasing and $f_n \rightarrow f$ pointwise on $\Omega$.
Tao gives the hint to define $$f_n(x) := \sup \left \{\frac j {2^n} : j \in \mathbb Z, \frac j {2^n} \leq \min(f(x),2^n) \right \}$$
Can someone help me to prove why all $f_n$ are measurable ?!
Expounding on the comments above, there are two paths to show this. The first is proving that for two measurable functions $f,g:\Omega\to\mathbb{R}$ (when $\mathbb{R}$ is equipped with the Borel $\sigma$-algebra), $f+g,\min\{f,g\},\max\{f,g\}$ are also measurable. Then, noting that the supremum is actually a maximum: $$f_n(x) = \sup\left\lbrace\frac{j}{2^n}\mid j\in\mathbb{Z},\ \frac{j}{2^n}\leq\min\{2^n,f(x)\}\right\rbrace =\\= \max\left\lbrace\frac{j}{2^n}\mid j\in\mathbb{Z}\cap[0,2^{2n}],\ \frac{j}{2^n}\leq\min\{2^n,f(x)\}\right\rbrace =\\= \max\left\lbrace \frac{j}{2^n}\chi_{\min\{2^n,f(x)\}^{-1}(\left[\frac{j}{2^n},\infty\right))}\mid j=0,1,\ldots,2^{2n}\right\rbrace.$$
Perhaps a more direct approach is to rewrite the functions in the following way: $$f_n(x) = 2^n\chi_{f^{-1}([2^n,\infty)} + \sum_{j=0}^{2^{2n}-1}\frac{j}{2^n}\chi_{f^{-1}(\left[\frac{j}{2^n},\frac{j+1}{2^n}\right))}.$$