Let $f(x):R\to C$ be a function from real number to complex value. And let we use the defination that if $f(x)=g(x)+i\cdot h(x)$, then $\int_{[a,b]}f(x)dx := \int_{[a,b]}g(x)dx + i\cdot\int_{[a,b]}h(x)dx$. How can I prove the inequality:
$$\left\lvert \int_{[a,b]}f(x)dx\right\rvert \le \int_{[a,b]}\left\lvert f(x)\right\rvert dx$$
If the inequality holds for $f$, it also holds for $zf$ for any $z\in \Bbb C$. Therefore, we may assume wlog that $\int_{[a,b]}f(x)\,\mathrm dx$ is a non-negative real. In this special case, we have $$\begin{align} \left|\int_{[a,b]}f(x)\,\mathrm dx\right|&=\int_{[a,b]}f(x)\,\mathrm dx\\&=\int_{[a,b]}g(x)\,\mathrm dx+i\int_{[a,b]}h(x)\,\mathrm dx\\& =\int_{[a,b]}g(x)\,\mathrm dx\\ &\le\int_{[a,b]}|g(x)|\,\mathrm dx\\ &\le\int_{[a,b]}|f(x)|\,\mathrm dx\end{align}$$