Critical points for a class of non-differentiable functions and applications