Average value of complex valued function property If $f:[a,b] \to \mathbb{C}$ is a continuous function define the average of $f$
$$A = \frac{1}{b-a} \int_a^b f(x)dx$$
where $\int f= \text{Re} (f) + i \int \text{Im}(f)$
Then I need to show that if $|f| \le |A|$ on $[a,b]$ then $f=A$. How to approach this?
 A: HINT: You can take the absolute value, multiply by $(b-a)$ and convert the left side to an integral: $$\int_a^b |A| dx = \left|\int_a^b f(x) dx\right|.$$
A: Assume that $A\ne 0$. We have 
\begin{align*}
|A|&=\dfrac{1}{b-a}\left|\int_{a}^{b}f(x)dx\right|\leq\dfrac{1}{b-a}\int_{a}^{b}|f(x)|dx\leq\dfrac{1}{b-a}\int_{a}^{b}|A|dx=|A|,
\end{align*}
so
\begin{align*}
\dfrac{1}{b-a}\int_{a}^{b}(|A|-|f(x)|)dx=0,
\end{align*}
but $|A|-|f(\cdot)|\geq 0$ and $|A|-|f|$ is continuous, one has $|f|=A$.
Now we let $z$ be a complex number such that 
\begin{align*}
zA=z\cdot\dfrac{1}{b-a}\int_{a}^{b}f(x)dx\geq 0,
\end{align*}
by writing $zf=u+iv$ for real $u,v$, then
\begin{align*}
|A|=\dfrac{1}{b-a}\left|\int_{a}^{b}f(x)dx\right|=\dfrac{1}{b-a}\int_{a}^{b}zf(x)dx=\dfrac{1}{b-a}\int_{a}^{b}u(x)dx+i\dfrac{1}{b-a}\int_{a}^{b}v(x)dx,
\end{align*}
so
\begin{align*}
\int_{a}^{b}v(x)dx=0,
\end{align*}
and hence 
\begin{align*}
|A|\leq\dfrac{1}{b-a}\int_{a}^{b}u^{+}(x)dx\leq\dfrac{1}{b-a}\int_{a}^{b}|f(x)|dx=|A|,
\end{align*}
hence
\begin{align*}
\int_{a}^{b}(|f(x)|-u^{+}(x))dx=0,
\end{align*}
once again $|f(\cdot)|-u^{+}(\cdot)\geq 0$, so $|f|=u^{+}$. Then $u^{+}+u^{-}=|u|\leq|f|=u^{+}$ implies $u^{-}=0$. Also, $|f|^{2}=(u^{+})^{2}+|v|^{2}=|f|^{2}+|v|^{2}$ implies $v=0$, so $zf=u^{+}=|f|=|A|$.
Substitute $f=z^{-1}|A|$ into 
\begin{align*}
A=\dfrac{1}{b-a}\int_{a}^{b}f(x)dx,
\end{align*}
one gets $z^{-1}=\dfrac{A}{|A|}$, so $f=A$.
