Example of real valued function that is not integrable on compact [closed]

Suppose we have a measurable function which is not bounded but, finite-valued. How can it not integrable on a compact interval?

I am thinking finite $\times$ finite = finite, if we look at it from a maximum $\times$ length perspective


Solution 1:

For an example, consider the function defined on the unit interval $[0,1]$: $$f(0)=0,\; and \;f(x)=n(n+1),\; for \;x\in(\frac{1}{n+1},\frac{1}{n}],\;n\in\mathbb{Z}_+.$$