Critical and subcritical fractional problems with vanishing potentials