Signum function of continuous function from $[a,b]$ to $\mathbb{R}$ Riemann integrable

calculusintegrationreal-analysisriemann-integration

This may be a very obvious question, so apologies for that.

I know that if $f: [a,b] \to \mathbb{R}$ is continuous, then the signum function $\sigma(f) \in L^1([a,b])$, but is it Riemann integrable?

I want to say that it is, but knowing of certain continuous functions like $g(x) = x^2\sin\left( \frac{1}{x}\right)$ for $x \neq 0$ and $0$ for $x=0$ make me nervous to say so.

My first thought was to consider the preimages $f^{-1}(0,\infty)$, $f^{-1}(\{0\})$ and $f^{-1}(-\infty,0)$ which are open and closed sets by continuity, so they can be written as countable unions of disjoint open intervals (and $f^{-1}(\{0\})$ can be written as the countable intersection of intervals of the form $(-\infty,x_k] \cup [y_k,\infty)$ by De morgans law).

I would figure that due to $\sigma(f)$ being defined on these 'nice' preimage sets that $\sigma(f)$ may be integrable, but im not seeing immediately why that would be the case.

Any input would be appreciated. Thanks!

Best Answer

Let $F$ be a fat Cantor set in $[0, 1]$, and define $f : [0, 1] \to \mathbb{R}$ by

$$ f(x) = \operatorname{dist}(x, F). $$

Then $f$ is non-negative and continuouos on $[0, 1]$. Moreover, $f(x) = 0$ if and only if $x \in F$, since $F$ is closed. So it follows that

$$ \operatorname{sgn}(f)(x) = \mathbf{1}_{F^c}(x) = \begin{cases} 0, & x \in F; \\ 1, & x \notin F. \end{cases} $$

Since $F$ is closed and nowhere dense, the point of discontinuity of $\mathbf{1}_{F^c}$ is precisely $F$. Also, $F$ has positive Lebesgue measure. So it follows that $\mathbf{1}_{F^c}$ is not Riemann integrable.