Nonparametric inference on monotone functions, with applications to observational studies