If $A$ is positive definite, $B$ is symmetric and $BAB = B$, how to show that $A^{1/2}BA^{1/2}$ is a diagonal matrix? 
If $A,B$ are symmetric $m$-by-$m$ matrices with $A$ positive definite, I want to show that $A^{1/2}BA^{1/2}$ is a diagonal matrix if it is given that $BAB=B$. Here $A^{1/2}$ is the positive definite square root of $A$.

I have been stuck on this problem for a long time. I have tried the decomposition of $A,B$ into the products of orthogonal matrices and diagonal matrices, but maybe the correct path has not hit me. I have not yet arrived at any notable result in trying to prove this. All my attempts have failed. 
I would really appreciate some help.
 A: Given $BAB = B$ we have $BA^{1/2}A^{1/2}B = B$ and multiplying by $A^{1/2}$ on both sides we find $(A^{1/2}BA^{1/2})^2 = A^{1/2}BA^{1/2}$. In other words $A^{1/2}BA^{1/2}$ is idempotent.
A symmetric idempotent matrix is a projection matrix.
A: The claim is not true in general. Take
$$
B=\pmatrix{1&0\\0&0}.$$
Let $A$ be symmetric positive definite mit $a_{11}=1$.
Then $BAB=B$.
If $A$ is not diagonal, then $A^{1/2} = \pmatrix{c_{11}&c_{12}\\c_{12} & c_{22}}$ is not diagonal, and 
$$
A^{1/2} B A^{1/2} = \pmatrix{c_{11}&c_{12}\\c_{12} & c_{22}} \pmatrix{1&0\\0&0} \pmatrix{c_{11}&c_{12}\\c_{12} & c_{22}} 
= \pmatrix{c_{11}&0\\c_{12}&0}\pmatrix{c_{11}&c_{12}\\c_{12} & c_{22}} 
= \pmatrix{c_{11}^2&c_{11}c_{12}\\ c_{11}c_{12}&c_{12}^2}
$$
is not diagonal either.

It in addition, $B$ is assumed to be invertible, then the claim follows.
Multipyling the equation $BAB=B$ with $B^{-1}$ yields
$$
AB=BA =I.
$$
Thus, $A=B^{-1}$, and $B$ is positive definite as well.

Denoting by $A^{1/2}$ the (uniquely determined) symmetric and positive definite square root of $A$, it follows, $A^{1/2} = (B^{-1})^{1/2} = (B^{1/2})^{-1}$.
Hence
$$
A^{1/2} B A^{1/2} = I,
$$
which is diagonal.
