Every constant function is locally constant. The converse will hold if its domain is a connected space.
Every locally constant function from the real numbers to is constant, by the connectedness of But the function from the rationals to defined by and is locally constant (this uses the fact that is irrational and that therefore the two sets and are both open in ).
If is locally constant, then it is constant on any connected component of The converse is true for locally connected spaces, which are spaces whose connected components are open subsets.
Further examples include the following:
- Given a covering map then to each point we can assign the cardinality of the fiber over ; this assignment is locally constant.
- A map from a topological space to a discrete space is continuous if and only if it is locally constant.
Hartshorne, Robin (1977). Algebraic Geometry. Springer. p. 62.