The key ingedient in the proof of this fact is the Cauchy-Schwartz Inequality. Apart from that, the proof is fairly straightforward.
The inequality in the second to last line is the Cauchy-Schwartz Inequality. The proof of the third property of metric spaces is now easily accomplished: