How can I optimize in the weight “w”? If I have $f(x),x > 0$ where $g(x)$ is an upper bound of $f(x)$ and $h(x)$ is a lower bound of $f(x)$, how can I optimize on the weight $w$ to approximate $f(x)$ in this way? 
$f(x) = w\cdot g(x) + (1-w)\cdot h(x).$

One idea to think about is minimizing the sum of distances of $wg(x)+(1-w)h(x)$ from $g(x)$ and $h(x)$ and imposing $h(x)\le wg(x)+(1-w)h(x)\le g(x)$. This can be captured by 
\begin{equation}
\begin{aligned}
\min_{w\in \mathbb R} \quad & 
 \int_{0}^{\infty} |g(x)-wg(x)-(1-w)h(x)| dx + \int_{0}^{\infty} |wg(x)+(1-w)h(x)-h(x)| dx  \\
\textrm{subject to} \quad &  h(x)\le wg(x)+(1-w)h(x)\le g(x); \ \\ \forall x\in [0,\infty),               \\
\end{aligned}
\end{equation}
which reduces to the following:
\begin{equation}
\begin{aligned}
\min_{w\in \mathbb R} \quad & 
  \int_{0}^{\infty} |w-1|[g(x)-h(x)] dx + \int_{0}^{\infty} |w|[g(x)-h(x)] dx \\
\textrm{subject to} \quad &  h(x)\le wg(x)+(1-w)h(x)\le g(x); \ \ \forall x\in [0,\infty).              \\
\end{aligned}
\end{equation}
This further is equivalent to below:
\begin{equation}
\begin{aligned}
\min_{w\in \mathbb R} \quad & 
\int_{0}^{\infty} (|w-1|+|w|)[g(x)-h(x)] dx  \\
\textrm{subject to} \quad &  h(x)\le wg(x)+(1-w)h(x)\le g(x); \ \ \forall x\in [0,\infty).             \\
\end{aligned}
\end{equation}
In general, note that assuming $k(x)$ is continous on $[a,b]$, we have $\int_{a}^{b} |k(x)| dx=0$ iff $k(x)\equiv 0$, almost everywhere.
