I'm studying analysis with Principles of Mathematical Analysis written by Walter Rudin.
In the proof of 11.7 Theorem, I don't understand how it can be proven that h is measurable.
I understand the first part of the proof which proves that g is measurable.
However, I can't follow how $h(x)$ is equal to $\inf g_{m}(x)$.
In the definition of $h(x)$ in the 11.7 Theorem, $h(x)$ is equal to $\limsup\limits_{n\rightarrow\infty} f_{n}(x)$.
Why is $\limsup\limits_{n\rightarrow\infty} f_{n}(x)$ equal to $\inf g_{m}(x)$?
Can anyone explain the relationship between $\limsup$ and $\inf$ in this case?
In addition, I don't understand how $g_{m}(x)$ is equal to $\sup f_{n}(x) (n\geq m).$
Especially, I suspect that $\sup f_{n}(x) (n\geq m)$ is misprinting and It should be $\sup f_{\bf{m}}(x) (n\geq m)$.
Should the $n$ at the last line of the proof be changed to $m$?

Pointwise, for any fixed $x\in X$ you have $\limsup\limits_{n\rightarrow\infty} f_{n}(x)= \underset{n\to \infty}{\lim}\big( \underset{k\geq n}{\sup} f_k(x) \big)$. However $\Big\{ \underset{k\geq n}{\sup} f_k(x) \Big\}_{n=1}^\infty$ is a decreasing sequence of values, since you are taking sup on smaller subsets, so the limit is the infimum of the last sequence.
They are defining $g_m(x):=\underset{n\geq m}{\sup} f_n(x)$, and they claim that $h(x)$ is the pointwise limit of $g_m$.
Later Edit:
The claim that $\limsup\limits_{n\rightarrow\infty} f_{n}(x)= \underset{n\to \infty}{\lim}\big( \underset{k\geq n}{\sup} f_k(x) \big)$, or alternatively that $\liminf\limits_{n\rightarrow\infty} f_{n}(x)= \underset{n\to \infty}{\lim}\big( \underset{k\geq n}{\inf} f_k(x) \big)$, is something you can see for example in Two definitions of lim sup. Pointwise limit just means that the limiting function is at each point $x$, the value of the limit function $f(x)$, satisfies $f(x)=\lim f_n(x)$.
Your other question is essentially why a monotonic sequence of measurable functions is measurable. This usually follows from considerations of the preimages. Essentially to show measurability, you need to show that the preimages of rays, $\{ x: h(x)\leq b \}$ or $\{ x: h(x)\geq a \}$, are measurable sets. You need to note that $$ \{x:\ sup_{n\in \Bbb N}f_n\ (x)\geq a\}=\bigcup_{n=1}^{\infty}\{x:\ f_n(x)\geq a\}$$ and $$\{x:\ sup_{n\in \Bbb N}f_n\ (x)\leq b\}= \bigcap_{n=1}^{\infty}\{x:\ f_n(x)\leq b\}. $$
You can also look at Sequence of measurable functions (lim sup) or the accepted answer in {x:limfn(x) exists} is a measurable set, for details.