Measurable function on $\Bbb{R}$ to a function on a closed interval $[a,b]$

If $u:\mathbb{R}\rightarrow \mathbb{R}$ is a $\mathcal{B}\setminus\mathcal{B}$ measurable function, can I then deduce that $u:[a,b]\rightarrow\mathbb{R}$ is measurable ($\mathcal{B}\cap[a,b]\setminus\mathcal{B}$)? And if yes, how can I then prove it?

-

$\mathcal B\cap [a,b]$ denote the trace of the Borel $\sigma$-algebra on $\mathcal B$, that is, the collection of set of the form $S\cap [a,b]$, where $S\in\mathcal B(\Bbb R)$. I will denote $v\colon [a,b]\to\Bbb R$ defined by $v(x)=u(x)$ for all $x\in [a,b]$.
We have to show that $v^{-1}(B)=[a,b]\cap u^{-1}(B)$ for all $B\in\mathcal B(\Bbb R)$. If $v(x)\in B$ for $x\in\Bbb R$, then $x\in[a,b]$ and $u(x)=v(x)\in B$. Conversely, if $u(x)\in B$ and $x\in [a,b]$ then $v(x)=u(x)\in B$. So $v^{-1}(B)\in [a,b]\cap \mathcal B(\Bbb R)$.