# Example of $f,g: [0,1]\to[0,1]$ and Riemann-integrable, but $g\circ f$ is not?

Give me an example of two Riemann-integrable functions $$f,g:[0,1]\to[0,1]$$ such that $$g\circ f$$ isn't integrable! I already know the following example: $$f(x)=\begin{cases} 0, & \text{if x is irrational} \\ 1, & \text{if x=0}\\ \frac1q, & \text{if x is rational and x=\frac pq such that q\in\Bbb N and (p,q)=1} \\ \end{cases}$$ $$g(x) = \begin{cases} 1, & \text{if x is of the form \frac 1qsuch that q\in \Bbb N} \\ 0, & \text{otherwise} \\ \end{cases}$$ now observe that $$g\circ f$$ is a famous example of non-integrable function!

• As it turns out, this particular $f$ and $g$ are not a great example--when you extend the definition of the integral to include more functions, $g \circ f$ integrates fine. – 6005 Mar 7 '14 at 20:30
• Extend to what?? – k1.M Mar 7 '14 at 21:12
• Lebesgue integration! The integral of $g \circ f$ turns out to be $0$. – 6005 Mar 8 '14 at 9:10
• Can someone explain why f is integrable? – Zslice Dec 17 '14 at 10:32

More simply, sticking with the same $f$ you may consider $$g(x) = \begin{cases} 0, & \text{if x=0} \\ 1, & \text{if x\in ]0,1]} \\ \end{cases}$$
• in this case$g\circ f$ is integrable! – k1.M Mar 7 '14 at 20:49