Locally constant function
.svg4200.png)
In mathematics, a function f from a topological space A to a set B is called locally constant, if for every a in A there exists a neighborhood U of a, such that f is constant on U.
Every constant function is locally constant.
Every locally constant function from the real numbers R to R is constant, by the connectedness of R. But the function f from the rationals Q to R, defined by f(x) = 0 for x < π, and f(x) = 1 for x > π, is locally constant (here we use the fact that π is irrational and that therefore the two sets {x∈Q : x < π} and {x∈Q : x > π} are both open in Q).