Norm of a linear functional Consider $C[0,1]$ (the space of continuous functions on $[0,1]$) with the max-norm (assume the underlying field is $\mathbb{R}$). For $g \in C[0,1]$, define $\Phi_g: C[0,1] \rightarrow \mathbb{R}$ by
\begin{equation*}
\Phi_g(f) = \int_0^1 f(t)g(t) \space dt,
\end{equation*}
where the integral is the ordinary Riemann integral.
I want to prove that $\Phi_g \in C[0,1]^*$ and $\| \Phi_g \|= \int_0^1 |g(t)| \space dt$. I've proved that
\begin{equation*}
\| \Phi_g(f) \| \leq \| f \| \int_0^1 |g(t)| \space dt.
\end{equation*}
Therefore, all I'm missing is an $f \in C[0,1]$ such that $\|f\| \leq 1$ and $\| \Phi_g(f) \| = \int_0^1 |g(t)| \space dt$. The constant functions $1$ or $-1$ work if $g$ is always positive or negative, respectively. Any idea about what function could do the job in any other case? My first idea was $f = |g|/g$, but this $f$ is not necessarily continuous.
 A: As Berci says, the idea is to approximate $|g|/g$ (where we define the function to be $0$ when $g(x)=0$) with continuous functions.  Here is a way to explicitly construct a sequence of continuous functions which approximate $|g|/g$, followed by an explicit and concrete sequence.
The idea is to convolve $|g|/g=\operatorname{sign}(g)$ with a family of mollifiers, that is, continuous functions which have area $1$ and which approach the delta function.  For example, let $f(x)=x+1$ if $-1\leq x\leq 0$, $f(x)=1-x$ if $0\leq x \leq 1$ and $0$ elsewhere.  Define $f_k(x)=kf(kx)$.  Then $\int f_k(x)dx=1$ and $f_k$ is supported on $[-1/k,1/k]$.  If you define $h_k=|g|/g\star f_k$ (where $\star$ denotes convolution), then $h_k$ will be continuous and $h_k\to |g|/g$  This is a general technique that will give you approximations converging to a given function (and if you convolve with a smooth family, it will give smooth approximations).  The disadvantage of this technique is that it's hard to say with certainty what the functions "look like".
A more concrete option is to take $h_n(x)=ng(x)$ if $|ng(x)|<1$ and $|g(x)|/g(x)$ otherwise.  Then $h_n$ converges to $|g|/g$.  Moreover, where $h_n\neq |g(x)|/g(x)$, we have $|g(x)|<1/n$, and so $|\int_0^1 g(x)(h_n(x)-|g(x)|/g(x))dx|<1/n$
A: Hint:
Not necessarily one function is what you need. Of course, the target is the mentioned $|g|/g$, but you can approximate it by continuous functions.
