I'm having trouble with this exercise in Rudin's PoMA (chapter 6 exercise 7)
a) is quite easy but I can't find a function satisfying b). I attempted to use $g \sin(1/x)$ for some $g$ with $\lim_{t\to 0} g(t)=0$ with no success. Of course $f$ can't be integrable in $[0,1]$ since in this case $|f|$ is too (because $|x|$ is continuous everywhere) and a) would imply that the limit exists.
Here is a full solution based on Jack D'Aurizio's answer.
Take $f(x) = (-1)^{[1/x]}[1/x], ~ x>0$ then for $\frac{1}{m+1}<x\le \frac{1}{m}$ where $m>0$ is a natural we have \begin{equation*} m \le \frac{1}{x} < m+1 \Rightarrow [1/x] = m \Rightarrow f(x) = (-1)^mm \end{equation*} hence \begin{equation*} \int_{\frac{1}{m+1}}^{\frac{1}{m}} f dx = (-1)^mm \left[ \frac{1}{m}-\frac{1}{m+1} \right] = (-1)^m \left[ \frac{1}{m+1} \right], ~ (m \ge 1) \end{equation*} thus if $0<c<1$ let $m=[1/c]\ge 1$ then \begin{align*} \int_{c}^{1} f dx - \int_{c}^{\frac{1}{m}} f dx = \sum_{i=1}^{m-1} \int_{\frac{1}{i+1}}^{\frac{1}{i}} f dx = \sum_{i=1}^{m-1}(-1)^i \left[ \frac{1}{i+1} \right] \\ = H_{m} - 1 \end{align*} But note that \begin{equation*} t \in [c,1/m] \Rightarrow [1/t] = [1/c] = m \end{equation*} thus \begin{equation*} \left|\int_{c}^{1/m} f dx\right| = \left|(-1)^mm \left[ \frac{1-cm}{m} \right]\right| =|1-cm| \end{equation*} and we have \begin{equation*} \left| \int_{c}^{1} f dx - (H_m-1) \right| = |1-cm| \end{equation*} but the latter satisfies, from the right, \begin{equation*} \lim_{c \to 0} |1-cm| = 0 \end{equation*} since \begin{align*} 1/c-1<[1/c]\le 1/c \Rightarrow 1-c < cm \le 1 \end{align*} therefore \begin{equation*} \lim_{c\to 0} \int_{c}^{1} f dx - (H_{[1/c]}-1) = 0 \end{equation*} but \begin{equation*} \lim_{c\to 0} H_{[1/c]}-1 = \sum_{i=2}^{\infty} \frac{(-1)^{i+1}}{i} \Rightarrow \lim_{c\to 0} \int_{c}^{1} f dx = \sum_{i=2}^{\infty} \frac{(-1)^{i+1}}{i} \end{equation*} thus $\int_{0}^{1} f dx$ converges.
By a similar argument we have, for $c \in (0,1)$, \begin{equation*} \int_{c}^{1} |f| dx = \sum_{i=1}^{m-1}\frac{1}{i+1} + \int_{c}^{1/m} |f| dx \ge \sum_{i=1}^{m-1}\frac{1}{i+1} \end{equation*} thus \begin{equation*} \int_{1/n}^{1} |f| dx \ge \sum_{i=2}^{n}\frac{1}{i} \end{equation*} which is unbounded above since this series diverges.