Positive linear functional $\phi\colon C(X)\to\mathbb{C}$ satisfies $|\phi(f)|\leq\phi(|f|)$ Let $X$ be a compact (Hausdorff) space. Let $C(X)$ denote the linear space of continuous complex-valued functions on $X$. Suppose that $\phi\colon C(X)\to\mathbb{C}$ is a positive linear functional. Thus $\phi(f)\geq0$ whenever $f\geq0$. I want to prove that $$|\phi(f)|\leq\phi(|f|)$$ for all $f\in C(X)$. For real-valued $f$ this is easy. Indeed, decompose $f=f_{+}-f_{-}$, where $f_{+}:=\max(0,f)$ and $f_{-}:=\max(0,-f)$, and observe that $$|\phi(f)|=|\phi(f_{+})-\phi(f_{-})|\leq\phi(f_{+})+\phi(f_{-})=\phi(|f|).$$
But how do I prove this for complex-valued $f$?
Also, is there a method that doesn't require proving the real-valued case first?
 A: First, let us observe that the proof for the real-valued case can be obtained quite simply as follows: As $|f|-f \geq 0$ for real-valued $f$, and $\phi$ is positive, we have $\phi(|f|-f)\geq 0$, and hence $\phi(|f|)\geq \phi(f)$. Similarly,  $|f|+f \geq 0$, so $\phi(|f|)\geq - \phi(f)$. So, we have $\phi(|f|) \geq |\phi(f)|$.
Now for the complex-valued case: Note that the inequality you are trying to prove, is trivially true when $\phi(f)=0$, as $|f|$ is always a positive function. Assume that $\phi(f)\neq0$, and consider the complex number $\lambda := \frac{|\phi(f)|}{\phi(f)}$. Then,
$|\phi(f)|=\phi(\lambda f)=\frac{1}{2}(\phi(\lambda f)+\overline{\phi(\lambda f)})=\phi(\frac{\lambda f+\overline{\lambda f}}{2})=\phi(\Re(\lambda f))\leq \phi(|\lambda f|) = \phi(|f|)$
Above, I used the fact that $\phi(\lambda f)=\overline{\phi(\lambda f)}$, and I used $\Re(g)$ to denote the real part of the function $g$, which is equal to $\frac{g+\overline{g}}{2}$, and can easily be seen to be less that $|g|$, so $\phi(|g|)\geq|\phi(g)|$.
Edit: To clarify that $\phi$ indeed preserves adjoints:
Note that for real functions $f$, we have $f=f_+-f_-$, with $f_+$ and $f_-$ being positive functions (the decomposition you stated in the question itself). So $\phi(f_+)$ and $\phi(f_-)$ are positive, and $\phi(f)=\phi(f_+)-\phi(f_-)$ is real.
Now note that for any $f$, $f=\Re(f)+ i \Im(f)$, where $\Re(f)=\frac{f+\overline{f}}{2}$, $\Im(f)=\frac{f-\overline{f}}{2i}$ are real functions. Then, $\overline{\phi(f)}=\overline{(\phi(\Re(f))+ i \phi(\Im(f)))} = \overline{\phi(\Re(f))} - i (\overline{\phi(\Im(f))}) = \phi(\Re(f)) - i \phi(\Im(f)) = \phi(\Re(f) - i \Im(f)) = \phi(\overline{f})$.
Note that in the above line we have used that $\Re(f)$ and $\Im(f)$ are real functions, and that $\overline{f}=\Re(f)-i\Im(f)$
A: By scaling, we may assume that $\phi$ is a state. Then, use the Riesz-Kakutani theorem that says that if $\phi \in C(X)^*$ is a state, there is a unique Radon probability measure $\mu$ such that
$$\phi(f) = \int_X f d\mu$$
for all $f \in C(X)$. Then, simply observe that
$$|\phi(f)| \le \int_X |f|d \mu = \phi(|f|)$$
and we are done.
