I was trying to understand the proof for the following proposition.
Proposition: If $\{f_n\}$ is a sequence of $\bar{\mathbb{R}}$ valued measurable functions on $(X,\mathcal{M})$, then the functions
$$g_1(x) = \sup_j f_j(x)$$ $$g_2(x) = \inf_j f_j(x)$$ $$g_3(x) = \lim_{j\rightarrow \infty} \sup f_j(x)$$ $$g_4(x) = \lim_{j\rightarrow \infty} \inf f_j(x)$$
are all measurable.
In the proof, it is given that $g_1^{-1}((a,\infty]) = \bigcup_1^{\infty}f_j^{-1}((a,\infty])$ and $g_2^{-1}([\infty,a)) = \bigcup_1^{\infty}f_j^{-1}([\infty,a)))$.
I am unable to understand these inverses of $g$. Can you please explain this?