I attended an Olympiad for student and failed. How should I write this down on my CV?
Firstly, you did not 'fail' - you were part of a team and competed - so congratulations on that.

Secondly, it can't hurt to include an entry in you CV under a heading like 'Other Achievements', something along the lines of:


  (Year), Competed as part of (Team) for the Student Physics Olympiad.


If you have space, briefly describe positive aspects of your participation.