A constant morphism in a category$\mathcal{C}$ is a morphism$c\colon B \to C$ with the property that if $f,g\colon A \to B$ are morphisms in $\mathcal{C}$ then $c \circ f = c \circ g$. In other words, for every object $A$, at most one morphism from $A$ to $C$ factors through $f$.

Thus, $c$ is a constant morphism if the function $c_* \colon \mathcal{C}(A,B) \to \mathcal{C}(A,C)$ given by composition with $c$ is a constant function for every object $A$.

Another definition that is sometimes used is the following.

Definition

A morphism $c\colon B \to C$ in a category $\mathcal{C}$ is constant if, for every object $A$, exactly one morphism from $A$ to $C$ factors through $f$. Assuming that $\mathcal{C}$ has a terminal object, $f$ is constant iff it factors through this terminal object.

This second definition implies the first, but they are not equivalent in general. In the category of sets, the first implies the second if the set $B$ is inhabited. More generally, if $c\colon B \to C$ is a morphism in a category $\mathcal{C}$, then the two definitions are equivalent if $\mathcal{C}(A,B)$ is inhabited for every $A$. If $\mathcal{C}$ has a terminal object $1$, then this is equivalent to the existence of a global section$b\colon 1 \to B$.