TITLE: Is this a category?
QUESTION [6 upvotes]: In Awodey's book Category Theory (second edition), on page 5 he asks if we have a category by taking "sets as objects and as arrows, those $f\, :\, A \rightarrow B$ such that for all $b \in B$, the subset $f^{-1}(b)\subseteq A$ has at most two elements (rather than one)". (The question follows a paragraph explaining why if we take sets to be objects and injective functions to be arrows, we have a category. I understand his explanation.) He seems to suggest the answer is "yes", but if you take $f$ to be a function from $\{1,2,3\}$ to $\{1,2\}$ and $g$ to be a function from $\{1,2\}$ to $\{1\}$, doesn't $g \circ f$ necessarily fail to be an arrow?

REPLY [4 votes]: I agree . Take:
$f:\{1,2,3,4\} \rightarrow \{1,2\}$ where $f(2)=f(4)=0$ and $f(1)=f(3)=1$ 
$g:\{1,2\}\rightarrow \{1\}$.
Then $g\circ f$ is not a morphism while $f$ and $g$ are.

Here is the actual text:
What if we take sets as objects and as arrows, those $f : A \rightarrow B$ such
that for all $b ∈ B$, the subset
$f ^{-1} (b) ⊆ A$
has at most two elements (rather than one)? Is this still a category? What
if we take the functions such that $f^{−1} (b)$ is finite? infinite? There are lots of such restricted categories of sets and functions.

Notice that the example where $f^{-1}(b)$ is asked to be finite is in fact a category. Perhaps that is what he means.