In the book of Linear Algebra by Werner Greub, at page 285, it is stated in a proof that
Let $E$ be a n-dimensional inner product space.Then $$(y_1, y_2) ^2 = (y_1, y_1) (y_2, y_2)$$ iff $y_1$ and $y_2$ are linearly dependent.
If it clear that $\Leftarrow$ holds, but how do we show $\Rightarrow$ ?
That direction is the equality case of the Cauchy-Schwarz inequality.