Approximation and function spaces