Proving that $\|Af\|_p=\sup_{g\geq 0, \|g\|_q=1}\int (Af\cdot g).$

We have by Holder's that $|\int_X(Af\cdot g)|\leq \|Af\|_p \|g\|_q=\|Af\|_p$ for all $g\in L^q$ with $\|g\|_q=1$. The question then becomes whether or not $g$ can be chosen to obtain equality.

Note that $1/p + 1/q=1$ implies that $1+p/q=p$ and $1+q/p=q$. Hence, choose $g=\frac{(Af)^{p/q}}{\|Af\|_p^{p/q}}$, which is nonnegative because $f$ is and $A$ preserves nonnegativity. Moreover, $\|g\|_q=1$.

But then $Af\cdot g=\frac{(Af)^{1+p/q}}{\|Af\|_p^{p/q}}=\frac{(Af)^{p}}{\|Af\|_p^{p/q}}$. Integrating, shows that $$ \int_X Af\cdot g=\frac{\|Af\|_p^p}{\|Af\|_p^{p/q}}=\|Af\|_p. $$