Let $m^{*}(B)<\infty,\, f(x)<\infty \ a.e. x\in B $ then exist $A\subset B$ such that $f(x)<\infty$ on A , and $m^{*}(B\backslash A)<\varepsilon$. I have a question about the proof of this problem;

Let $m^*$ is lebesgue measure, $m^{*}(B)<\infty$, measurable function $f:B\to [0,\infty]$ is $f(x)<\infty$ a.e. $x\in B$. Then $\forall \varepsilon>0, \exists A\subset B$:measurable set s.t. $f(x)<\infty$ on A and $m^{*}(B\backslash A)<\varepsilon$.

My proof;

$A:=\{ f<\infty\}$. So $A$ is measurable set because $A=B\backslash (B \backslash A)$ and $ m^*(B \backslash A)=m^*(\{ f=\infty\})=0 $. In particular, it satisfies $m^{*}(B\backslash A)<\varepsilon$ for any $\varepsilon>0$.

However, the proof in the book I read was somewhat complicated and used
$$ \lim_{n\to\infty}m^*(\{f>n \})=m^*(\cap_{n=1}^{\infty}\{f>n \})=m^*(\{ f=\infty\})=0. $$
My proof is so simple that it feels wrong. Please let me know if there is something I am missing.
 A: I assume that as usual you are considering the Borel $\sigma$-algebra in $[-\infty , +\infty]$.
Your proof is essentially correct. it needs jus a small correction:

$A:=\{ f<\infty\}$. So $A$ is measurable set because $f$ is measurable. Now $ m^*(B \backslash A)=m^*(\{ f=\infty\})=0 $. In particular, it satisfies $m^{*}(B\backslash A)<\varepsilon$ for any $\varepsilon>0$.

Remark:
First: Your book must be also using the Borel $\sigma$-algebra in $[-\infty , +\infty]$. Otherwise, it would be unclear the meaning of $f:B\to [0,\infty]$ being a measurable function.
So, saying that  $f:B\to [0,\infty]$ is a measurable function means that we are using the Borel $\sigma$-algebra in $[-\infty , +\infty]$ in the counter-domain. (To use any other $\sigma$-algebra, your book should explicitly say so).
Second: To say  $f(x)<\infty$ a.e. $x\in B$ means that $m^*(\{ f=\infty\})=0$. So it really seems odd that your book assumes as a condition that  $f(x)<\infty$ a.e. $x\in B$  and then would "prove" it.  Of course, to explain why the book is the way it is , we would need more information on what is written there.
A: You have included $\infty$ in the image of $f$ so the sigma algebra w.r.t which u r saying $f$ is measurable must also include $\infty$ element. Please define it. This is the reason why the book has chosen the approach as this shows $f^{-1}(\infty)$ is measurable and also that its measure is $0$. Note that $\infty$ is a limiting notion. Thats what the book is using.
