TITLE: Is a function that maps every compact set to a compact set continuous?
QUESTION [5 upvotes]: A continuous function maps a compact set to a compact set. Is the converse of this true? That is, is a function that maps every compact set to a compact set necessarily continuous?

REPLY [8 votes]: The characteristic function of the rationals maps every set, in particular every compact set, to a compact set. But it is discontinuous at every point.