Weighted approximation of functions with endpoints or inner singularities by Bernstein operators