You have

Now square both sides:

Then bring x-y and y-z into play on the right side, like this

Then multiply out (using the inner product on the right)

Thus it follows:

(I am assuming a vector space over here.) Now consider this last equation: it should remind you of the Cauchy-Schwarz inequality. So you are asked to prove under what condition equality holds in the Cauchy-Schwarz inequality. Quite possibly, you can simply refer to your lecture notes on the Cauchy-Schwarz inequality.