Let a pieceswise function of two variables
$$f(x,y)=\begin{cases}
f_1(x,y)&\text{if}\, y\geq 0\\
f_2(x,y)&\text{if}\, y<0\\
\end{cases}$$
with $f_1$ and $f_2$ continuous.
I have to prove that $f(x,y)$ is Lebesegue measurable in $\mathbb{R}^2$.
I have thought to take $A\in\mathbb{R}^2$ open set (so it is mesaurable). By continuity then $f_1^{-1}(A)$ and $f_2^{-1}(A)$ are still measurable, so
$$f^{-1}(A)=(f_1^{-1}(A)\cup [0,\infty))\cup (f_2^{-1}(A)\cup (-\infty,0)$$
is measurable by union of measurbale set.
Do you think my attempt is right?
You are almost right, but you should write $$f^{-1}(A)=(f_1^{-1}(A)\cup (\mathbb R \times[0,\infty)))\cup (f_2^{-1}(A)\cup (\mathbb R \times (-\infty,0))$$