I am puzzled by the following problem:

> 
> Suppose all vectors and matrices are defined on $\Bbb R ^n$ and $\bf A,B$ are both $n\times n$ square matrices. Is it true that if ${\bf x}^\text{T} {\bf Ay} = \bf{x}^\text{T}\bf By$ for all $\bf x,y$ then $\bf A = B $?
> 
> 
> 

I tried to prove this without success. Can anyone help me with a proof or provide a counterexample? Thank you!