How to prove the "bang-bang" characterization on the alignment between $L_1[0,1]$ and $L_\infty[0,1]$? I am following Luenberger's book "Optimization by Vector Space Methods". The author's solution to Example 2 on Page 124 obviously has utilized the following result on the characteristic of alignment between $L_1[0,1]$ and $L_\infty[0,1]$.
Let $y\in L_1[0,1]$ and $u\in L_\infty[0,1]$. Then
$$\int_0^1 y(t)u(t)dt = \|y\|_{L_1}\cdot \|u\|_{L_\infty}$$
holds iff $u(t) = \text{sgn}(y(t))\cdot M$ for some constant $M$ for a.e.
I am wondering how to prove this result? Thank you!
PS: As pointed out by both answerers, I should add the condition that $y(t)$ can only be zero on a set of measure zero.
 A: This is false if $y=0$ (or $y=0$ with positive measure)  so I will assume that the set of points where $y=0$ has measure $0$. We have $\|y\|_{L^{1}} \|u\|_{L^{\infty}} =\int_0^{1} y(t)u(t) dt \leq \int_0^{1} |y(t)u(t)| dt \leq \|u\|_{L^{\infty}} \int_0^{1} |y(t)|dt=\|y\|_{L^{1}} \|u\|_{L^{\infty}}$. Hence equality must hold throughout. This shows that $y(t)u(t)=|y(t)u(t)|$ a.e. and $|u(t)|=\|u\|_{L^{\infty}}$ a.e. Let $M=\|u\|_{L^{\infty}}$. Then $u(t)=sgn (y(t))M$ a.e. because $u$ has the same sign as $y$ and $|u|$ is a constant.
The converse part is obvious. 
A: This clearly isn't true if $y = 0$ on a set of positive measure since we can set $u$ to be equal to any constant $\le \|u\|_{L^\infty}$ there and it won't affect the value of the integral. Therefore assume $y \ne 0$ a.e.
We have
\begin{align}
0 &\le \int_0^1 |y(t)|\big(\|u\|_{L^\infty} - u(t)\operatorname{sgn}(y(t))\big)\,dt \\
&= \|u\|_{L^\infty}\left(\int_0^1 |y(t)|\,dt\right) - \int_0^1 |y(t)|u(t)\operatorname{sgn}(y(t))\,dt \\
&= \|u\|_{L^\infty}\|y\|_{L^1}-\int_0^1 y(t)u(t)\,dt\\
&= 0
\end{align}
so $|y(t)|\big(\|u\|_{L^\infty} - u(t)\operatorname{sgn}(y(t))\big) =0$ a.e.
This implies $u(t)\operatorname{sgn}(y(t)) = \|u\|_{L^\infty}$ a.e., or
$$u(t) = \|u\|_{L^\infty} \operatorname{sgn}(y(t)) \,\text{  a.e.}$$
A: Here I'll re-organize mechanodroid's solution above, fill in some more detail, and then comment on two key steps, based on my learning experience. My purpose is to help other amatures like me (engineering background, not mathematician) to improve their skill. However all the credit should definitely go to mechanodroid. 
Since I am new here, please let me know if I am not supposed to re-organize an answer from another people under "Your Answer" so I'll delete it.
Proof:
We will only prove that the alignment condition implies $u(t)=\text{sgn}(y(t))M$ holds a.e. for some constant $M$. The converse is obvious.
$$\begin{aligned}&||u||_{L^\infty}||y||_{L^1}-\int_0^1 y(t)u(t)dt=||u||_{L^\infty}\int_0^1 \big|y(t)\big|dt-\int_0^1 \text{sgn}(y(t))\big|y(t)\big|u(t)dt\\
          &= \int_0^1 \big|y(t)\big|\Big(||u||_{L^\infty}-\text{sgn}(y(t))u(t)\Big)dt\end{aligned}$$
From the condition $||u||_{L^\infty}||y||_{L^1}=\int_0^1 y(t)u(t)dt$, we then have
$$\int_0^1 \big|y(t)\big|\Big(||u||_{L^\infty}-\text{sgn}(y(t))u(t)\Big)dt=0 \hspace{2em} (\ast)$$
On the other hand,
$$||u||_{L^\infty}-\text{sgn}(y(t))u(t)\geq 0 \hspace{2em} (\ast\ast)$$
and
$$\big|y(t)\big|>0 \enspace \text{a.e.} \hspace{2em} (\ast\ast\ast)$$,
Combining $(\ast)$, $(\ast)$ and $(\ast\ast\ast)$, we see it must be true that
$$||u||_{L^\infty}-\text{sgn}(y(t))u(t)=0 \enspace \text{a.e.}$$
or,
$$u(t) = \text{sgn}(y(t))||u||_{L^\infty} \enspace \text{a.e.}$$
Comments: There are two key elements in the above proof:
(1) Write $y(t)$ as $\text{sgn}(y(t))\big|y(t)\big|$;
(2) See that $||u||_{L^\infty}-\text{sgn}(y(t))u(t)\geq 0$.
