Theorem 1.14 of Complex and real analysis by Rudin states: if $f_n:X\to [-\infty, +\infty]$ is measurable for $n = 1,2,3...$ and: $$g=\sup_{n\geq 1} f_n,~~~~h=\limsup_{n\to \infty} f_n,$$ then $h$ and $g$ are measurable.
The first step is $$g^{-1}((\alpha, \infty]=\cup_{n=1}^\infty f_n^{-1}((\alpha, \infty])$$
Where does this come from?
I am pretty sure the question is a duplicate but I can't find the one I saw 2 or 3 months ago that had a nice answer with all the passages.
It's all about unravelling the definitions. You need to show $g(x) > \alpha$ if and only if for some $n \in \mathbb{N}$, $f_n(x) > \alpha$.
Suppose first $g(x) > \alpha$. Then by definition of $\sup$, there exists $n\in \mathbb{N}$ such that $f_n(x) >\alpha$, for if not, $\alpha$ would be an upper bound of the set $\{ f_n(x) \, | \, n \in \mathbb{N}\} $, which implies $g(x) \leq \alpha$ because $g(x)$ is the least upper bound of that set.
Now conversely, suppose $f_n(x)>\alpha$ for some $n\in \mathbb{N}$. Then because $g(x)$ is an upper bound of the set $\{ f_n(x) \, | \, n \in \mathbb{N}\} $, we have $g(x) \geq f_n(x) > \alpha$, as required.