# If $f(x) \le g(x) \le h(x)$ for all $x\in D$ and $f$, $h$ are Riemann integrable, then so is $g$. True or False? (Check my work) [duplicate]

If $f(x) \le g(x) \le h(x)$ for all $x\in [a,b]$, and f and h are Riemann integrable on
[a,b], then so is g. True or false? Explain.

A: True
Proof:

Since $f\in R[a,b]$, $\bar \int_a^b{f} = \int_a^b\bar{f}$ (That's supposed to be an underbar), so $\int_a^b{f} \le U(P,f)$.
Since $h\in R[a,b]$, $\bar \int_a^b{h} = \int_a^b\bar{h}$, so $\int_a^b{h} \ge L(P,h)$.
Therefore, since $f(x)\le g(x) \le h(x)$, and $\int_a^b{f} \le U(P,f)$ and $\int_a^b{h}\ge L(P,f)$,
$U(P,f) \le \int_a^b{g} \le L(P,h)$ which implies $U(P,f) \le L(P,g) \le U(P,g) \le L(P,h)$

So $g(x)\in R[a,b]$.

-

## marked as duplicate by Cameron Buie, muzzlator, Dominic Michaelis, Micah, Davide GiraudoMar 27 '13 at 18:26

Isn't a function like $1$ if $x \in \mathbb{Q}$, $0$ otherwise not Riemann integrable? And it's bounded by lots of Riemann integrable functions – muzzlator Mar 27 '13 at 17:54
False. Take $f=0$, $h=1$, and $g$ to be your favorite bounded non-Riemann integrable function (like the indicator function of rationals). – Calvin Lin Mar 27 '13 at 17:55
To show Riemann integrability of $g$ on $[a,b]$, you must show that for all $\epsilon>0$, there is a partition $P$ of $[a,b]$ such that $$U(P,g)-L(P,g)<\epsilon.$$ What you've done isn't enough. – Cameron Buie Mar 27 '13 at 18:04

It's wrong, take the Dirichlet function $$g(x)=\begin{cases} 0 & x\in \mathbb{R}\setminus \mathbb{Q}\\ 1 & x \in \mathbb{Q}\\ \end{cases}$$ and $f(x)=0$ and $h(x)=1$, obviously $f\leq g\leq h$ and $f,h$ are riemann integrable
Let $I:=[0,1]$ and $g(x)=\chi_{\mathbb{Q}\cap[0,1]}(x)$. Then $0\leq g\leq 1$ and $0$ and $1$ are both Riemann integrable in $I$ but $g$ isn't.
Why isn't it Riemann integrable? The upper Riemann sum is always $1$ and the lower sum is always $0$. Hence it can't be Riemann integrable