This is something I've been curious about. Suppose $(X,\mathcal{R})$ is some measurable space, and $X=\bigcup_n A_n$ where the $A_n$ are measurable, but not necessarily disjoint. On each of these $A_i$ I have some measurable function $f_i$ into $\mathbb{R}$. Luckily, if $x\in A_i\cap A_j$, then $f_i(x)=f_j(x)$, so at least these functions agree on places where their domains intersect.
If I define $f\colon X\to\mathbb{R}$ by $f(x)=f_i(x)$ when $x\in A_i$, then $f$ is at least well-defined. Is $f$ measurable also? Cheers.