The question is:

Show that if $\displaystyle g:\mathbb{R} \longrightarrow [0,\infty) $ equals 0 outside a bounded interval and $\displaystyle \int g^2 < \infty $ , then $\displaystyle \int g < \infty $

It doesn't appear so difficult, but i dont know how to progress in it. I say let I be the bounded interval, then $\displaystyle \int g^2 = \int_{\mathbb{R}} g^2 \chi_I < \infty $ how do i progress from here? i dont know how to get $\displaystyle \int g $ from this! thanks