A locally constant function is a function whose value never changes. This is a weaker concept than that of a constant function, which has only one value. They correspond on a connected space. However, in general, a function may be locally constant but not constant, since it can take values on two distant components without the values' ever changing between them (since there is no path between them).
If $X$ is a topological space and $Y$ is any set, then a function $f$ from (the underlying set of) $X$ to $Y$ is locally constant if, for every element $a$ of $X$, $f$ is constant when restricted to some neighbourhood of $a$.
We have $Y$ here as a set; but in fact, $Y$ may be given any topological structure; then every locally constant function $f$ will become a locally constant continuous map.
(continuous function into discrete space is locally constant)
A function into a discrete topological space is continuous precisely if it is locally constant.
A locally constant function is a section of a constant sheaf;
a locally constant sheaf is a section of a constant stack;
a locally constant stack is a section of (… and so on…)
a locally constant ∞-stack is a section of a constant ∞-stack.
A locally constant sheaf / $\infty$-stack is also called a local system.