Adaptive approximation of monotone functions