Let $u \in L^p(0,1)$. Define $\tilde u:(0,\infty) \to \mathbb{R}$ as the function which equals $u$ on $(0,1)$ and $\tilde u =0$ on $(1,\infty)$.
I cannot figure out why this function is measurable. The integral is obviously finite but I don't know about the measurability. How do I justify it?
Look at the inverse image of a generating measurable set.
$$\bar{u}^{-1}(a,b)$$
If $a<0<b$ then because inverse images and unions commute, i.e. $f^{-1}(A\cup B)=f^{-1}(A)\cup f^{-1}(B)$ we get:
$$=u^{-1}(a,0)\cup (1,\infty)\cup u^{-1}(\{0\})\cup u^{-1}(0,b)$$
this is a finite union of measurable sets, hence measurable.
If $0\not\in (a,b)$ then $\bar{u}^{-1}(a,b)=u^{-1}(a,b)$ which, again, is measurable. So in both cases the inverse image of a generating set for the (Borel) $\sigma$-algebra is measurable, hence the extended function is.