[ Remark: The following question was asked yesterday, and obtained 3 votes. Unfortunately it has been deleted by the OP overnight without receiving any answers.]
Let $f:\mathbb C \to \mathbb R$ be a continuous real-valued function. Suppose for all $z \in \mathbb C$, we have $|f(z)|\leq1$. Show that
$$\left|\int_C f(z)\, dz\right|\leq4$$ where $C$ is the unit circle traversed counterclockwise.
I used this relationship but the smallest I can get is $2\pi$: $$\left|\int f(z)\, dz\right| \leq \int |f(z)|\, |dz| \leq \sup |f(z)|\cdot L = 2\pi\sup |f(z)| = 2\pi$$
The function $g(t):=f\bigl(e^{it}\bigr)\in[{-1},1]$ is $2\pi$-periodic. By definition of the line integral the parametrization $t\mapsto z(t):=e^{it}$ $(0\leq t\leq2\pi)$ gives $$\int_C f(z)\>dz=\int_0^{2\pi} g(t)\>ie^{it}\>dt=:i\rho \,e^{i\alpha}$$ for some $\rho\geq0$ and $\alpha\in{\mathbb R}$. We have to prove that $\rho\leq4$. To this end consider $$\int_0^{2\pi}g(t+\alpha)e^{it}\>dt=\int_0^{2\pi}g(\tau)e^{i(\tau-\alpha)}\>d\tau=\rho\ .$$ Since $g$ is real-valued we can conclude that in fact $$\rho=\int_0^{2\pi} g(t+\alpha)\,\cos t\>dt\leq\int_0^{2\pi}\bigl|\cos t\bigr|\>dt=4\ .$$