Problem:
Let $(X,S)$ be a measure space. $f:X\rightarrow [-\infty,\infty]$ is $(S,\overline{B})$ measurable if and only if $f^{-1}((a,\infty])\in S$ for all $a\in \mathbb{R}$.
Note here $\overline{B}$ denotes the borel algebra on the extended real line.
My attempt:
The forward direction clearly holds, since $(a,\infty]\in \overline{B}$. Converse:
$f^{-1}(\infty)=\bigcap_{n=1}^{\infty}f^{-1}(n,\infty]$ . Hence $f^{-1}(\infty)\in S$. Moreover,
$f^{-1}(-\infty)= (\bigcup_{n=1}^{\infty}f^{-1}(n,\infty]))^c$ .
Define $f_1:X\rightarrow \mathbb{R}$ by $f_1(x)=f(x)$ if $x\in f^{-1}(\infty)\cup f^{-1}(-\infty)$ and 0 otherwise.
It suffices to show that $f_1$ is borel measurable.
Let $a\in \mathbb{R}$, then either $f_1^{-1}(a,\infty)=f^{-1}(a,\infty] \backslash f^{-1}(\infty)$ or $f_1^{-1}(a,\infty)= f^{-1}(a,\infty]\cup f^{-1}(-\infty)$.
In either case, the result follows by properties of a sigma algebra.
Is my proof correct? (please answer this)
Your proof looks correct. The argument can be boiled down to just two main observations:
You did something like (1) in showing that the preimages of $\{\infty\}$ and $\{-\infty\}$ under $f$ are both in $S$, and by saying "it suffices to show that $f_1$ is Borel-measurable."