# Integrable step function that extends to infinity?

I was asked to construct a non-negative step function from R to R that is Lebesgue integrable, but requiring limsup f(x)=infinity. Is that even possible? I thought step functions consist of finite number of intervals with each interval assigned a constant. That said limsup should be one of the finite number of constants?

It's definitely possible. You can construct a step function that is equal to $n$ on an interval of length $1/n^3$ for large positive $n$. Then the area of each bit is $n\cdot 1/n^3=1/n^2$, and since $\sum_{n=1}^\infty 1/n^2$ converges, you can make the entire Lebesgue integral make sense. But we're not bounded above, so $\limsup f(x)=\infty$.