On the continuity of weakly monotone functions