Given the measurable space (X,$B$) where $B$ is a $\sigma$-algebra, I want to show that if $f : X\rightarrow \mathbb{C}$ is measurable (in the sense that, there exists a sequence of simple functions such that $lim_{n\rightarrow\infty}f_{n}(x)=f(x)$ for every $x\in X$) then $f^{-1}(U)\in B$.
I can get that for every single $x\in f^{-1}(U)$ there exists an $N\in\mathbb{N}$ such that $f_{n}(x)\in U$ for $n\geq N$
Also I can prove that as $f_n$ are simple functions then $f_n^{-1}(U)\in B$ but I am struggling trying to prove a relationship between $f^{-1}(U)$ and $f_n^{-1}(U)$.
My idea is trying to write:
$$f^{-1}(U) = \bigcap_{n\in\mathbb{N}}f_n^{-1}(U)$$
If that was true then I could write $f^{-1}(U)$ as the intersection of sets of $B$ and given that $B$ is a $\sigma$-algebra it would conclude the proof.
Any correction or idea will be welcomed.
Since $U$ is open and $\lim_{n\rightarrow\infty}f_{n}(x)=f(x)$ for every $x\in X$, we have that, for all $x$:
$$ f(x) \in U \iff \textrm{ there is } k\in\mathbb{N} \textrm { such that, for all } n\in\mathbb{N}, \; n>k,\; f_n(x)\in U $$
So in other words:
$$ x\in f^{-1}(U) \iff \textrm{ there is } k\in\mathbb{N} \textrm { such that, } x\in \bigcap_{n>k}f_n^{-1}(U)$$
It follows that
$$ f^{-1}(U) = \bigcup_{k\in\mathbb{N}} \bigcap_{n>k}f_n^{-1}(U)$$
Since $f^{-1}(U)$ as the union of intersections of sets of $B$ and $B$ is a $\sigma$-algebra, we have that $f^{-1}(U)$ is a set of $B$, which concludes the proof.