Let $f$ be defined on a measurable set $E \subset \mathbb R^n$. How to show that if $\{a<f<+\infty\}$ and $\{f=-\infty\}$ are measurable for every finite $a$, then $f$ is measurable? I think I need to separate the set $\{a<f<+\infty\}$, then do some set operations. Any hint?
EDIT: This question is part of a corollary.
The definition of measurable function is that $f$ is called a Lebesgue measurable function on $E$, or simply a measurable function, if for every finite $a$, the set $$\{\mathbf{x}\in E: f(\mathbf{x})>a \}$$ is a measurable subset of $\mathbb R^n$.
It is enough to show that the set $\{x\in E: \ f = +\infty\}$ is measurable, since then for each finite $a$ we get that the set $$ \{x \in E: \ f(x) > a \} = \{x\in E: \ f = +\infty\} \cup \{x \in E: \ +\infty>f(x) > a \} $$ is a union of two measurable sets, hence measurable itself.
To see that $\{x\in E: \ f = +\infty\}$ is measurable, observe that in view of the measurability of $\{x\in E: \ f = -\infty\}$ its complement is also measurable, hence $$ \tag{1} \{x\in E: \ f = -\infty\}^c = \{x\in E: \ f > - \infty\} = \\\{x\in E: \ f = +\infty\} \cup \left( \bigcup\limits_{n=-\infty}^{+\infty} \{x \in E: \ n<f(x) < +\infty \} \right). $$ Now the union in big brackets is measurable as a countable union of measurable sets. Since the left-hand side of $(1)$ is also measurable, the claim follows.