# Confusion regarding Stochastic integral

I've a stupid doubt in the construction of stochastic integral of real scalar valued maps. Many times I've seen in books after the stochastic integral is defined in [$0,T$] for the integrand in $L^2$ where $E(\int_{0}^{T}f(s)^2ds)<\infty$ we again use localization technique to extend the stochastic integral to more general processes $P(\int_{0}^{T}f(s)^2ds<\infty)=1$. My questions are

1. For a finite measure space if a random variable is almost everywhere finite then does not it mean that it expectation is finite? That too when I work in [$0,T$] not in [$0,\infty$]

2. Can someone give me a counter example stating that a function belonging to the more general localization-technique defined space and not into the $L^2$ space.

I'm omitting the details as these are very standard and can be found in text books.

-

No, almost surely finite does not imply integrable. Consider a random variable $X$ exponential with parameter $1$ and $Y=\mathrm e^X$. Then $X$ is almost surely finite hence $Y$ is almost surely finite but, for every $y\geqslant1$, $\mathrm P(Y\geqslant y)=\mathrm P(X\geqslant\log y)=\mathrm e^{-\log y}=1/y$, hence $Y$ is not integrable.