Give an example of a continuous function $f : [0, ∞) \mapsto [0, ∞)$ such that $\int_{0}^{\infty}f(x)dx$ exists but $f$ is unbounded. Give an example of a continuous function $f : [0,  ∞) \mapsto [0, ∞)$ such that  $\int_{0}^{\infty}f(x)dx$ exists but  $f$ is unbounded. 

I have been thinking about this. And I have come to the conclusion that I will need to construct a function, $f$, such that $f$ is a sequence of triangles of increasing height, but decreasing base.
I obviously need $f$ such that both the height of the triangles, and sum of the bases tends to infinity.
But I also need that the $\sum (\text{height} \times \text{base}) \leq \infty $
Building off your idea, but allowing most of the triangles to have zero height (otherwise it will not converge): Choose some divergent series. I'll assume we're dealing with the harmonic series $\sum \frac{1}{n}$. The nth triangle will have base $\frac{1}{n}$.

Now in general, start with $f \equiv 0$, i.e. suppose the general triangle we have is degenerate. But let the $2^n$th slot have a triangle of height $2^{n/2}$.

Or more generically: have some shape that has area $1$ from $0$ to $1$, then some shape that has area $\frac{1}{2}$ from $1$ to $2$, $\frac{1}{4}$ from $2$ to $3$, smoothing as necessary. You can make your function $0$ as much as you want, but you need to make your shapes get taller. You can think of fitting a triangle of height $k$ in the $k$th slot, making the base the necessary width to give area $\frac{1}{2^k}$ in that slot.

You can do many more along these lines.
Let $f= \cases{ x^{-1/2} , &amp; $[0,1)$ \\ x^{-2} , &amp; $[1,\infty )$ }$, then $\int_0^\infty f(x)dx = 3$. Is that what you are looking for?

EDIT: In the spirit of mixedmath: Let $Tr(x,h,w)=\max (1-|2x/w -1| , 0 )h$. Then let $h_i=i^{1/4}$ and $w_i=1/i^{2+1/4}$. Let $f=\sum_{i=1}^\infty Tr(x-i,h_i,w_i)$ such that 
\begin{equation}
\int_0^\infty f(x) dx = \int_0^\infty\sum_{i=1}^\infty Tr(x-i,h_i,w_i) dx= 1/2\sum_{i=1}^\infty i^{-2}=\pi^2/12
\end{equation}
with questionable convergence.