I am working out on a notion of measurable function from Stein-Shakarchi's book but there are some moments which are unclear to me.
Let $E$ be a measurable subset of $\mathbb{R}^d$.
Definition: The function $f:E\to \mathbb{R}$ is called measurable if for any $a\in\mathbb{R}$ the set $f^{-1}((-\infty,a))=\{x:f(x)<a\}=\{f<a\}$ is measurable.
Claim: Let $\{f_n\}$ be a sequence of measurable functions. Then $\sup \limits_{n}f_n(x)$ is also measurable function.
Proof: Let $a$ be any real number then $\{x: \sup \limits_{n}f_n(x)>a\}=\bigcup\limits_{n=1}^{\infty}\{x:f_n(x)>a\}$ but the last set is measurable.
Warning: Pay attention that even if $f_n$ are real-valued functions the $\sup _{n}f_n$ may takes value from extended real line. But the authors do not prove nothing more.
So I guess that we need to show something else, right? Moreover, we need to introduce the definition of measurable function $f:E\to \overline{\mathbb{R}}$ and use this definition to prove the measurability of $\sup f_n$.
Would be very grateful for help.
A function with values in $\overset {-} {\mathbb R}$ is called measurable if $f^{-1}(A)$ is measurable for each Borel set $A$ in $\mathbb R$ and $f^{-1} \{\infty\}$,$f^{-1} \{-\infty\}$ are measurable. If you show that $\{x:f(x)>a\}$ is measurable for each real number $a$ then $f^{-1} \{\infty\}$ is automatically measurable because $f^{-1} \{\infty\}=\cap_n \{x:f(x)>n\}$. Similarly, $f^{-1} \{-\infty\}=\cap_n E_n$ where $E_n$ is teh complement of $\{x:f(x)>-n\}$.