Direct and inverse error estimates for finite elements with mesh refinements