Let we have a function: $f:X\rightarrow \mathbb{R}$. Let's suppose that the sets $A_n=\{x\in{R}:f(x)<\frac{-1}{n}\}$ are measurable for every $n$. I have to prove that $A=\{x\in \mathbb{R}:f(x)\le0\}$ is measurable too.
This is what I have done:
As $A_n=\{x\in \mathbb{R}:f(x)<\frac{-1}{n}\}$ are measurable for every $n$, $\bigcup_{n\in \mathbb{N}}\{x\in{R}:f(x)<\frac{-1}{n}\}$ is measurable. (I'm not sure about it).
And now, if we do the limit, $\lim_{n\to \infty}\{x\in{R}:f(x)<\frac{-1}{n}\}=\{x\in{R}:f(x)\le 0\}$.
So can I say that $\{x\in{R}:f(x)\le 0\}$ is measurable and beacuse of that, I have proved that $A$ is measurable too?
Is this prove ok? If not, how can I prove it?
A countable union of measurable sets is indeed measurable. In fact, the set of measurable sets is a $\sigma$-algebra, which by definition is closed under countable unions and the complement operation. (Hence it is also closed under countable intersections). You don't have to take the limit of of the sequence of sets $A_n$. Simply notice that the union of the $A_n$'s is actually equal to the set $A_0=\{x:f(x)<0\}$. Now if the function $f$ is measurable, then the set $\{x:f(x)=0\}$ is also measurable, so your set $A$ is a union of measurable sets. However, in general, as Klaus pointed out, it need not be true.