Proving f Riemann integrable implies |f| Riemann integrable by contradiction. I know that there exists a theorem telling us that if a real valued function $f$ defined over an interval $[a,b]$ is Riemann integrable, then |$f$| is too (moreover I believe the converse to be false). I've tried to look at the proofs, but they seem a bit beyond my ability at the moment. My first thought was to suppose there existed a Riemann integrable function, let us say $g$, such that |$g$| was not Riemann integrable, and show that this leads to some sort of contradiction.
I thought about this for a while and have not been able to think of such a function/proof. Would anybody know of such an example?
Let $a,b\in\mathbb{R}$ with $a&lt;b$. Suppose $f:[a,b]\to\mathbb{R}$ is bounded and Riemann integrable. It suffices to show that for any interval $I\subseteq[a,b]$, we have that $$\sup_{x\in I}|f|-\inf_{x\in I}|f|\leq\sup_{x\in I}f-\inf_{x\in I}f $$
where $\sup_{x\in I}g(x)$ is defined as $\sup\{g(x)\in\mathbb{R}:x\in I\}$ if $g$ is a function that is bounded on $I$.
Note that for $x\in I$, we have $f(x)\leq |f(x)|$.
Break this into three cases:
Case 1:
$\inf_{x\in I}f(x)\geq 0$. In this case, we have that $f(x)\geq 0$ for all $x\in I$. This means $|f(x)|=f(x)$ so $$ \sup_{x\in I}|f|=\sup_{x\in I}f\text{ and }\inf_{x\in I}|f|=\inf_{x\in I}f$$ which implies that $$\sup_{x\in I}|f|-\inf_{x\in I}|f|=\sup_{x\in I}f-\inf_{x\in I}f $$
Case 2:
$\sup_{x\in I}f(x)\leq 0$. In this case, we have that $f(x)\leq 0$ for all $x\in I$, thus $|f(x)|=-f(x)$. Then we get that $$\sup_{x\in I}|f|=-\inf_{x\in I}f \text{ and }\inf_{x\in I}|f|=-\sup_{x\in I}f$$ so in particular, we have
$$\sup_{x\in I}|f|-\inf_{x\in I}|f|=-\inf_{x\in I}f-\big(-\sup_{x\in I}f\big)=\sup_{x\in I}f-\inf_{x\in I}f$$
If you want Case 2 to follow relatively quickly, it would suffice to show the following:
Let $A\subseteq\mathbb{R}$ be non-empty and bounded. Define $-A=\{-a\in\mathbb{R}:a\in A\}$. Then $\sup(-A)=-\inf(A)$ and $\inf(-A)=-\sup(A)$.
Case 3:
$\inf_{x\in I}f\leq 0\leq\sup_{x\in I}f$. I will leave this case to you, as it requires some sub-cases based upon the magnitudes of $\inf_{x\in I}f$ and $\sup_{x\in I}f$.
With this it should be easier to finish the proof.
For instance $f(x)=\begin{cases}\dfrac x{1-x}\,,x\in[0,1)\\\dfrac{x}{1+x}\,,x\in(-1,0]\\0\,,x=\pm1\end{cases}$, would provide a counter-example.  We have $\int_{-1}^1f\rm dx=0$, but $\int_{-1}^1|f|\rm dx=\infty$.