I know that there are several posts on the same question. They all ask for examples for morphisms that are not functions. So, morphisms are more general than functions; they are the arrows connecting the objects of a category. However, I still cannot avoid the idea that they are functions.
By function, I mean exactly that the relation is well-defined. If $(a, b_1), (a, b_2)$ are inside the graph of $f: A \to B$, then $b_1 = b_2$. Therefore, if a morphism, say $g: A \to B$, is not a function, then I am allowed to have $(a, b_1), (a, b_2)$ inside the graph of $g$.
But, without the condition that they are well-defined, I do not see how associativity holds. For example, let:
- The graph of $f: A \to B$ contains $(a, b)$;
- The graph of $g: B \to C$ contains $(b, c_1), (b, c_2)$;
- The graph of $h: C \to D$ contains $(c_1, d_1), (c_2, d_2)$.
- The graph of $f': A \to D$ contains $(a, d_1), (a, d_2)$
So, $h((g \circ f)(a)) = d_1$ or $d_2$? Similarly, $(h \circ g)(f(a)) = d_1$ or $d_2$? This is what I mean; if I am forced to choose either $(a, d_1)$ or $(a, d_2)$, then indeed I am dealing with functions ....