How can I find the maxima and minima of the function $f:\mathbb{RP}^2 \rightarrow \mathbb{R},\space f([x,y,z])=\frac{xy+yz+2zx}{x^2+y^2+z^2}$ ?
I believe that I have to use the Lagrange multipliers to get the desired result, but I have absolutely no idea how.
The function is homogeneous of degree $0$ - in other words, scaling all the variables by $\lambda$ does not change the value of the function. So, you can normalize by setting $x^2 + y^2 + z^2=1.$ Now, Lagrange multipliers are your friend.