Prove the inequality $|xy|\leq\frac{1}{2}(x^2+y^2)$ [duplicate]

Note that we have the following truth:

$$x^2+y^2-2xy=(x-y)^2\ge 0\to 2xy\le x^2+y^2$$ and $$x^2+y^2+2xy=(x+y)^2\ge 0\to -(x^2+y^2)\le 2xy$$


Nothing new, just with a slightly different approach: for $\,x,y\in\Bbb R$ :

$$\pm xy\le\frac{x^2+y^2}2\iff x^2\pm 2xy+y^2\ge 0\iff (x\pm y)^2\ge0$$

and since the rightmost inequality is trivial we're done.