# Example of Riemann integrable function which their composition is not Riemann integrable

I already know that there is a univariate real-valued function $f, g$ such that $f, g$ are Riemann integrable but $\ g \circ f$ is not Riemann integrable.

But I wonder the existence of the univariate real-valued function $f$ which is Riemann integrable but $f\circ f$ is not Riemann integrable

I know that Riemann integrable function is continuous almost everywhere on its domain, but i cannot think of the function which is continuous almost everywhere but its composition with itself is not continuous almost everywhere

Second, I thought about the example using improper integral such as

$f :[1, \infty) \rightarrow \boldsymbol R$ $s.t$ $f(x) = 1/x^2$

But this function did not work, since $Im(f) = (0,1]$, thus $f \circ f$ is defined only on $x = 1$

I intuitively think such an $f$ exists. Please give me an example of this function.

• You should stick to the proper case first, where things are cleanly defined. The improper case will be more delicate.
– Ian
Dec 16, 2016 at 6:56

Cardinality of the set of points of discontinuity of $(f\circ f)\le$ cardinality of the set of points of discontinuity of $f$ because suppose that $f\circ f$ is discontinuous at $a$ then $f$ is discontinuous at $f(a)$

Now set of points of discontinuity of $f$ has measure $0$ and hence so Set of all points of discontinuity of $(f\circ f)$ has measure $0$.

• Thank you for your answer, but I got in trouble with understanding first inclusion. I think the function f(x) = x + 1 (x < 0), f(x) = x + 2(x >=0) does not fit to that inclusion. That funcion f is discontinous at x = 0 only, but (f composite f) is discontiunous at x = -1.
– T.K
Dec 16, 2016 at 9:59
• I meant the cardinality of the set @T.K Dec 16, 2016 at 10:33
• I missed the word cardinality in your explanation. I did not think about the measure of discontinuities itself. Thank you for your help
– T.K
Dec 16, 2016 at 10:41
• You can accept it if you wish Dec 16, 2016 at 10:43
• This answer is wrong. Example: math.stackexchange.com/questions/1060834/… Jun 30, 2021 at 6:46