Hardy inequalities for functions vanishing at negligible sets and its applications