This is exercise 7.3.3 from Abbot's Understanding analysis. The section is Integrating functions with discontinuities.
I am struggling with this exercise. I can't either come up with any simple counterexamples or produce a satisfactory proof.
I was able to solve a), and here are some answers to b) that I don't understand well because they use a bit of measure theory: Answer 1, Answer 2. I still don't know whether c) is true or false.
Any hints to a proof, the proof itself, or simple counterexamples are highly appreciated.
The exercise reads:
Let $f$ and $g$ be functions defined on (possibly different) closed intervals, and assume the range of $f$ is contained in the domain of $g$ so that the composition $g \circ f$ is properly defined.
a) Show, by example, that it is not the case that if $f$ and $g$ are integrable, then $g\circ f$ is integrable.
Now decide on the validity of each of the following conjectures, supplying a proof or counterexample as appropriate.
b) If $f$ is increasing and $g$ is integrable, then $g\circ f$ is integrable.
c) If $f$ is integrable and $g$ is increasing, then $g\circ f$ is integrable.
EDIT
I found a solution to b) here, due to Chutong Wu. The solution seems to contradict the counterexamples from above, as it provides a proof of the statement. I reproduce the proof in full:
Fix $\epsilon > 0$. Because $g$ is integrable, we can find a partition $P_{g}=\{x_{0}<\cdots <x_{n}\}$ of $Rng(f)\subseteq Dom(g)$ such that $U(g\lvert_{Rng(f)}, P_{g})-L(g\lvert_{Rng(f)}, P_{g})<\epsilon$.
Because $f$ is increasing, it is one-to-one so $f^{-1}:Rng(f)\rightarrow Dom(f)$ is well-defined and also increasing. This means the set $P=\{f^{-1}(x_{0}),\cdots,f^{-1}(x_{n})\}$ is also a partition of $Dom(f)$.
We then have:
$ \begin{align} U(g\circ f, P)-L(g\circ f, P) &=\sum_{k=1}^{n}( \underbrace{\sup_{[x_{k-1},x_{k}]} g\circ f}_{=(g\circ f)(f^{-1}(x_{k}))=g(x_{k})} - \underbrace{\inf_{[x_{k-1},x_{k}]} g\circ f}_{=(g\circ f)(f^{-1}(x_{k}))=g(x_{k-1})}) [x_{k-1},x_{k}] \\ &= U(g\lvert_{Rng(f)}, P_{g})-L(g\lvert_{Rng(f)}, P_{g})<\epsilon \end{align} $
(c) Let $\phi:\mathbb{N}\rightarrow(0,\infty)$ be a monotone nonincreasing sequence such that $\phi(n)\xrightarrow{n\rightarrow\infty}0$. Define $f:[0,1]\rightarrow\mathbb{R}$ as follows $$f(x)=\left\{\begin{array}{lcr}1 &\text{if} & x=0\\ 0 &\text{if} & x\in[0,1]\setminus\mathbb{Q}\\ \phi(n) &\text{if}& x=\frac{m}{n},\quad (m,n)=1 \end{array} \right. $$
The case $\phi(x)=\frac{1}{x}$ yields what is know as Thomae's function. It can be seen that $f$ is continuous at irrational points. Thus $f$ is $R$-integable over $[0,1]$ (by Lebesgue's criteria).
Consider the function $g(x)=\mathbb{1}_{(0,\infty)}(x)$. This function is monotone nondecreasing, and $$h(x)=g(f(x))=\mathbb{1}_{[0,1]\cap\mathbb{Q}}(x)$$ which is not $R$-integrable.
By considering $G(x)=x+g(x)$, we obtain an strictly monotone increasing function such that $G\circ f$ is not $R$-integrble.
Just for completion, here is a proof that the Thomae-like function $f$ defined above is indeed continuous at every $x\in[0,1]\setminus\mathbb{Q}$. Fix $x_0\in [0,1]\setminus\mathbb{Q}$ and $\varepsilon>0$. Let $r\in\mathbb{R}$ such that $\phi(r) <\varepsilon$. For each $j\in\{1,\ldots r\}$ let $k_j=\lfloor jx_0\rfloor$. Since $x_0$ is irrational $$k_j<jx_0<k_j+1$$ Let $\delta:=\min_{1\leq j\leq r}\left\{\big|x_0-\frac{k_j+1}{j}\big|,\big|x_0-\frac{k_j}{j}\big|\right\}$. Suppose $\operatorname{g.c.d}(p,q)=1$ and $|x-p/q|<\delta$. We claim that $q>r$, otherwise $q\leq r$ and so $p\leq k_q$ or $p\geq k_p+1$. This in turn implies that $$\big|x-\frac{p}{q}\big|\geq\delta$$ which leads to a contradiction. Therefore, if $|x-p/q|<\delta$, $$|f(p/q)-f(x)|=f(p/q)=\phi(q)\leq \phi(r)<\varepsilon$$