Continuous function $f$ on $\mathbb R $ such that $f \notin L^1 (\mathbb R)$ but $f \in L^1([a,b]), a< b $ Give an example of a continuous function $f$ on $\mathbb R $ such that $f \notin L^1 (\mathbb R)$ but $f \in L^1([a,b]), a< b $
If $f \in L^1([a,b]), a< b$ that would mean that $$\int_{a}^{b}|f(x)|dx < \infty \text{ but $f \notin L^1 (\mathbb R)$ means} \int_{\mathbb R}|f(x)|dx\to \infty \text { or undefined.}$$
I feel like there are many examples for this, like $f(x)=x$, but this was given on a exam, so I think I am not understanding this correctly, what are your guys' thoughts on this? 
Also the second part of the question was to give an example of a continuous function $f$ on $\mathbb R $ such that $f$ is Reiman integrable on $\mathbb R$ but $f \notin L^1 (\mathbb R)$ . Now this seems like it is impossible to me. We have done the other way around in class, but this I just don't know at all how I would go about, maybe constructing a set that satisfies this. Help is needed, very thankful for insight.  

Basically both example are correct, and you can think at any continuous function having a non zero limit at infinity... 
For the second statement, Riemann integrable implies Lebesgue integrable, I think maybe, you forgot the term improperly front of Riemann integrable.
