How should I prove that the function $x^2$ where $x^+=\max(x,0)$, $x^-=-\min(x,0)$ and $|x|=x^+ + x^-$ is a Borel function?
I know that a Borel function is a random variable $\mathbb{R} \rightarrow \mathbb{R}$. But how to mathematically prove it? I have no idea... May be I should use indicators? But how?
$f: \mathbb{R} \rightarrow \mathbb{R}$ is borel $\iff \; \forall B \in \mathcal{B}(\mathbb{R}) : f^{-1}(B) \in \mathcal{B}(\mathbb{R}) \iff \; \forall b \in \mathbb{R} : f^{-1}(-\infty,b) \in \mathcal{B}(\mathbb{R}).$
$$ f^{-1}((-\infty,b)) = \{x : x^2 \in (-\infty,b) \} = \{ x : x^2 < b \}$$
If $b < 0 :$ then $\{ x : x^2 < b \} = \varnothing.$
If $b \geq 0$ then
$$ x^2 < b \iff - \sqrt b < x < \sqrt b.$$
So $$ f^{-1}((-\infty,b))= \begin{cases} \varnothing &\in \mathcal{B}(\mathbb{R}) & b < 0 \\ (-\sqrt b, \sqrt b)& \in \mathcal{B}(\mathbb{R}) & b \geq 0\end{cases}$$ and $f$ is borel.
Consider $f(x) = \vert x \vert.$ Let $b \in \mathbb{R}$:
$$ f^{-1}(-\infty ,b) = \{x \in \mathbb{R} : f(x) = \vert x \vert < 0\} = \varnothing$$
Since the empty set is an open (closed) it is a borel set so $ f^{-1}(-\infty ,b) \in \mathcal{B}(\mathbb{R}) \in \forall b < 0$.
$$ f^{-1}(-\infty ,b) = \{x \in \mathbb{R} : f(x) = \vert x \vert < b\} = (-b,b)$$
Since $(-b,b)$ is an open set it is a borel set and $ f^{-1}(-\infty ,b) \in \mathcal{B}(\mathbb{R}) \in \forall b \geq 0.$