Okay I think I have an idea but I want to make sure it isn't stupid
So, assume $\langle Ax,Bx\rangle = 0$ for all $x$, then $A+B = 0$
The idea is that then $\langle Ax,Bx\rangle + \langle Bx,Ax\rangle = 0$ as well, so that $\langle (A+B)x,(A+B)x\rangle = \|(A+B)x\|^2 = 0$ for all $x$
Yeah that should do it if I'm not braindead
Because then $\langle Ax,x\rangle = \langle x,p(A)x\rangle$ for all $x$, so that $\langle (A-I)x,(I-p(A))x\rangle = 0$ for all $x$
But then this implies that $A - p(A) = 0$, so we're done