Norm of integration operator Consider the operator $A:C([a,b])\to \mathbb R$ with
$$Af = \int_{[a,b]} f(x)g(x) \,dx$$
where $g\in C([a,b])$ is fixed. The space $C([a,b])$ is equipped with the $\infty$-norm here.

I want to show that $\|A\| = \int_{[a,b]} |g(x)| \, dx$.

I have already shown "$\leq$" inequality but I'm stuck at the "$\geq$" inequality.
The dream would be to define $f(x)= |g(x)| / g(x)$ and then deduce that (since $\|f\|_\infty =1$), we have $\|A \| \geq |Af| =  \int_{[a,b]} |g(x)| \, dx$. But of course the issue is that this $f$ may divide by $0$. So I attempted to restrict to the subset $M_\epsilon = \{x \in [a,b] : g(x) \geq \epsilon\}$. We can define $f_\epsilon = |g(x)| / g(x)$ on this subset and then extend it to a function on all of $[a,b]$ by Tietze's extension theorem. Call the extension $f$.
Then we have
$$\|A\| \geq |Af| = \left|\int_{M_\epsilon} |g(x)| \, dx +  \int_{[a,b]\setminus M_\epsilon} f(x) g(x) \, dx \right| $$
How can we proceed?
 A: $$ \Vert A\Vert = \sup_{f\neq 0}\frac{|Af|}{\Vert f \Vert} = \sup_{f\neq 0}\frac{\left|\int f(x)g(x)~dx\right|}{\sup |f(x)|} = \sup_{f\neq 0} \left|\int \frac{f(x)}{\sup|f(x)|}g(x)~dx\right|.$$
Since $\left|\frac{f(x)}{\sup|f(x)|}\right|\leq 1$, we also have that the quantity on the far right of which we take the supremum (to which I will refer as $Q[f]$) is less than or equal to
$$\left|\int g(x)~dx\right|\leq \int |g(x)|~dx.$$
Observe as you have, that the choice of $f^\dagger(x) = \operatorname{sgn}(g(x))$ gives the equality
$$ Q[f^\dagger]=\left|\int \frac{f^\dagger(x)}{\sup|f^\dagger(x)|}g(x)~dx\right| = \int |g(x)|~dx,$$
however, the sign function is not continuous, so this choice of $f^\dagger$ may not be. Instead, we form the sequence of functions $f_n(x) = \arctan(ng(x))$, which converges pointwise to our $f^\dagger$, and are clearly dominated by an integrable function (say $h(x) = 1$). So the dominated convergence theorem lets us say that
$$ \lim_{n\to\infty}Q[f_n]=\lim_{n\to\infty}\left|\int \frac{f_n(x)}{\sup |f_n(x)|}g(x)~dx \right|= \int |g(x)|~dx. $$
In other words, the RHS is a limit point of the image in $\mathbb{R}$ of $C([a,b])$ under the action of $Q$. Since we know that
$$Q[f]\leq \int |g(x)|~dx,$$
we conclude that it is the supremum.
