Assume $f$ is an integrable function on $\mathbb{R}^N$. Then by definition, it is easily seen that
$$\int_{\mathbb{R}^N} |f| dx = \sup \left\{ \int_{\mathbb{R}^N} g dx: 0 \le g \le |f| \right\}.$$ However, I'm looking for another formula. In particular, is it true that
$$\int_{\mathbb{R}^N} |f| dx = \sup \left\{ \int_{\mathbb{R}^N} fg dx: g \in C^{\infty}_c(\mathbb{R}^N): -1 \le g \le 1 \right\}?$$
Thanks for your help.
Hint: I think you can prove it by truncation and regularization of the sign function $\text{sgn}(f)$. You could define
$$g_n(x) = \rho_{n} * \left(\text{sgn}(f)\chi_{|x|\le n}\right)$$
with $\rho_n = n^N\rho(nx)$ and $0\le \rho\in {\cal C}_0^\infty({\mathbb R}^N)$ satisfies $\int \rho dx = 1$.
Then it seems reasonable to think that $f g_n\longrightarrow |f|$ almost everywhere (see the Lebesgue density theorem for example) and the result would follow by dominated convergence.