# Can the sign of a continuous function be 'made Riemann integrable'?

Question:

I would like to know whether the following statement is true:

For every continuous function $f:[0,1]\to\mathbb{R}$ there is a Riemann-integrable function $g:[0,1]\to\mathbb{R}$ with values in $[-1,1]$ such that $\int f\cdot g=\int |f|$.

Motivation:

I am trying to prove that the canonical bounded linear injection $X\to X^{**}$ of a normed space into its double (continuous) dual is isometric, for the specific case of $X=C[0,1]$ in the $L^1$-norm, without using Hahn-Banach, and without using the Lebesgue integral.

So I want to constructively cook up for each continuous $f$ a functional $\alpha$ on $C[0,1]$ of norm 1 which maps $f$ to its norm.

From Lebesgue integration we know: the dense inclusion $C[0,1]\to L^1[0,1]$ yields an isomorphism $L^\infty[0,1]\cong(L^1[0,1])^*\to (C[0,1])^*$, so every functional (of unit norm) on $C[0,1]$ must be given by integration against an essentially bounded function (with essential supremum equal to 1). I am hoping to get such a function which is Riemann integrable.

Some thoughts:

A naive guess is to take $g_0=|f|/f$, i.e. the 'sign' of $f$, and set it to be $0$ (say) on points where $f$ is zero. Then $g_0=1_{\{f>0\}}+0\cdot 1_{\{f=0\}}-1_{\{f<0\}}$.

This $g_0$ is measurable (the sets $\{f>0\},\{f<0\}$ are open as $f$ is continuous) with essential supremum equal to 1. But I am afraid this (for suitable $f$) is NOT Riemann integrable for the following reason. Riemann integrability of this bounded function is equivalent to being continuous outside a set of measure zero. If I am not mistaking, the discontinuity set of $g_0$ is precisely $\partial\{f=0\}$, the boundary of the zero set of $f$. Since every closed set of $[0,1]$ is the zero-set of a continuous function (e.g. the 'distance to that set'), it suffices to construct a closed set of nonzero measure consisting solely of boundary points. For example the closure of a nowhere dense set (i.e. a closed with empty interior) of positive measure will do. The (closure of the) fat Cantor set is an example of such a set.

My problem is that this $f$ (the distance function) does not take both positive and negative values, and I could imagine that an adjustment of the behaviour of $g_0$ at $\{f=0\}$ could 'compensate' for this.

-
I notice that you didn't say "such that $f\cdot g = |f|$", but rather "such that $\int f\cdot g = \int |f|$". That's a weaker condition, so maybe we can satisfy it without satisfying the stronger condition that you didn't write. –  Michael Hardy Sep 28 '12 at 18:39

A function is Riemann-integrable if its set of points of discontinuity has measure $0$. Suppose $f$ is continuous and $$g=\begin{cases} |f|/f & \text{where }f\ne 0, \\[8pt] 1 & \text{where }f=0. \end{cases}$$ Where are the discontinuities of $g$? They are at the boundary points of the open set of points where $f<0$. That set of boundary points is at most countably infinite, regardless of the fact that the set of zeros of $f$ may have positive measure. So $g$ is Riemann-integrable.

Later note: This might not work: the boundary may contain more points than those endpoints. See the comments below.

-
Why is $\partial\{f<0\}$ countable (or even of measure zero)? If $f$ is minus my proposed distance function, then $\{f<0\}$ and $\{f=0\}$ are complements so have the same boundary of positive measure, right? –  wildildildlife Sep 28 '12 at 8:23
I will have to think about your second sentence and I'm a bit rushed right now..... However, as to your first sentence, what I had in mind was this: $\{f<0\}$ is an open set. An open subset of the real line is the union of an at most countable set of open intervals. The set of boundary points of those intervals is therefore at most countable. –  Michael Hardy Sep 28 '12 at 13:43
Yes, I thought that was what you meant. My problem is that taking the 'boundary' and 'disjoint union' need not commute. There are open subsets of $\mathbb{R}$ whose boundary have nonzero measure. See this related question, where our old friend the Cantor set again defies our (well, at least my) intuition. –  wildildildlife Sep 28 '12 at 14:30
After typing the comment above, it occurred to me that some open sets have boundary points in addition to those endpoints. I was thinking of $\bigcup\limits_{n=0}^\infty \left(\frac{1}{2n+2},\frac{1}{2n+1}\right)$. One of the boundary points is $0$. So my answer is at best incomplete, and possibly can't be made complete without altering the function $g$. –  Michael Hardy Sep 28 '12 at 16:13
So suppose you have two disjoint open subsets $A$ and $B$ of the real line, and let $C$ be the complement of $A\cup B$, and let $f(x)$ be the distance from $x$ to $C$ if $x\in A$ and the $(-1)$ times the distance from $x$ to $C$ if $x\in B$, and $0$ if $x\in C$. Suppose $C$ has positive measure. The question is whether the set of points of discontinuity of the indicator function of $A\cup C$ might have positive measure. If so, then the particular function I proposed above won't work. –  Michael Hardy Sep 28 '12 at 16:43