Let $H$ be a Hilbert space over $\mathbb{R}$ and $P$ is a bounded linear operator over it. If $$ (Px,x)=\|Px\|^2,\quad \forall x\in H, $$ I want to show $P$ is a projection.
If $H$ is a Hilbert space over $\mathbb{C}$, I know how to prove it. Note that $$ (Px,(I-P)x)=0,\quad\forall x\in H. $$ For any $x,y\in H$, we have $$ (P(x+y),(I-P)(x+y))=0. $$ Using $(Px,(I-P)x)=(Py,(I-P)y)=0$ we can get $$ (Px,(I-P)y)+(Py,(I-P)x)=0. $$ Substitute $x$ by $\mathrm{i}x$ and we can get $$ (Px,(I-P)y)-(Py,(I-P)x)=0 $$ and $$ (Px,(I-P)y)=0,\quad\forall x,y\in H. $$ Thus, $P$ is a projection.
But for $H$ over $\mathbb{R}$, I have no idea. If the symmetry of $P$ could be proven, then $$ (Px,(I-P)y)=((I-P)x,Py)=(Py,(I-P)x) $$ and $P$ is a projection.
Any help is welcome!