Let $(X,\Omega,\mu)$ be a $\sigma$-finite measure space and put $\mathscr{H}=L^{2}(X,\Omega,\mu)=L^2(\mu)$. If $\phi \in L^\infty(\mu)$, define $M_\phi:L^2(\mu) \to L^2(\mu)$ by $M_\phi f=\phi f$. Then $M_\phi \in \mathscr{B}(L^2(\mu))$ and $\|M_\phi\|=\|\phi\|_\infty$.
The operator $M_\phi$ is called a multiplication operator. I want to show that
$M_\phi=M_\phi^2$ if and only if $\phi$ is a characteristic function.
$\longleftarrow$ If $\phi$ is a characteristic function we have $M_\phi(M_\phi(f))=M_\phi(\phi f)=M_\phi(f)$.
How I can prove the converse?
We want to show that if $\phi \in L^\infty$ and $\phi f = \phi^2 f$ for every $f$ in $L^2$ then $\phi$ must be a characteristic function. That is, we want to show that $\phi$ takes values in $\{0,1\}$ a.e. (since $\phi$ is measurable by assumption).
Suppose that this is not the case. Then one of the measurable sets $A_1 = \{ x: \phi(x) > 1 \}, A_2 = \{ x: \phi(x) \in (0,1) \} , A_3 = \{ x: \phi(x) < 0\}$ has positive measure. Say $\mu(A_i) > 0$. Then since our measure space is $\sigma$-finite, $A_i$ has a measurable subset of positive, finite measure which we call $B_i$. Then $1_{B_i} \in L^2$. In particular, $\phi 1_{B_i} = \phi^2 1_{B_i}$ almost everywhere. But this is impossible by construction of the $B_i$.