We consider the space of continuous functions in $[-1,1]$ that has the usual inner product $(f,g)=\int_{-1}^1 f(x) g(x) dx$.
I want to characterize the optimal approximation of a function $f \in C[-1,1]$ from the space of polynomials of degree $\leq 2$.
Could you give me a hint how we could do this?