Pointwise inequalities in variable Sobolev spaces and applications