(a) Give an example of a $f:\mathbb{R}\to\mathbb{R}$ such that $\mathcal{L}^p(\mathbb{R})\not\ni f\in\mathcal{L}^q(\mathbb{R})$ for $1\leq p\leq q$
(b) Give an example of a $f:\mathbb{R}\to\mathbb{R}$ such that $\mathcal{L}^\infty(\mathbb{R})\not\ni f\in\mathcal{L}^p(\mathbb{R})$ for $ p \in[1,\infty)$
$f\in\mathcal{L}^q(\mathbb{R})$ if
$$\int_\mathbb{R} |f|^q \;d\mu < \infty$$
(a)
$$f(x) = e^{{-x}^{1/q}} \textbf{1}_{[0, \infty)}$$
Then
$$\int_\mathbb{R} \left| e^{{-x}^{1/q}} \textbf{1}_{[0, \infty)}\right|^q \;d\mu = \int_{[0,\infty)} e^{-x} \;d\mu = 1$$
$$\int_\mathbb{R} \left| e^{{-x}^{1/q}} \textbf{1}_{[0, \infty)}\right|^p \;d\mu = \int_{[0,\infty)} e^{{-x}^{p/q}} \;d\mu = \infty$$
Seems like a complicated example (you need complex analysis to prove the last integral does not converge), but I cannot think of anything simpler.
I believe, there should be a much simpler example.
(b)
$f\in\mathcal{L}^\infty$ if $f$ is bounded almost everywhere i.e. $|f |\leq c \quad a.e$ for some $c\geq0$
$$f(x)=\begin{cases} x&x\in\mathbb{Q} \\ 0&otherwise \end{cases}$$
$f(x)$ is not bounded and $$\int_\mathbb{R} |f|^p \;d\mu = 0$$ for all $p\in[0,\infty)$
I need help verifying these examples and suggestions on other maybe easier/more intuitive examples.
Some nice counterexamples:
For a): $f(x) = x^{-1/p} 1_{(1,+\infty)}$.
For b): $f(x) = \log(x)l 1_{(0,1)}$.