Non-disjointness of hom-sets In the category $\bf Set$ of sets, $\mathcal C$ is the class of all sets. Given
sets $A$, $B$ the set $\text{Hom}(A, B)$ consists of all functions from $A$ to
$B$.
This is a standard example of a category but I did not understand how they ensure that $\text{Hom}$ is disjoint, that is
    For any $(A,B)\neq(C,D)$ then $\text{Hom}(A,B)\cap\text{Hom}(C,D)=\emptyset,$
where $A,B.C,D\in\mathcal C.$ Let $1_A$ be an identity map so $1_A\in\text{Hom}(A,A)$. Since $A\subset B$, we have the inclusion map $i\colon A\to B$ with $i\in\text{Hom}(A,B).$ Thus $1_A$ and $i$ are mathematically the same, so $$\text{Hom}(A,A)\cap \text{Hom}(A,B)\neq \emptyset.$$ I know I am wrong since $\mathcal C$ is definitely a category. Can anyone help me understand what I did wrong?
Also, what is a good reference as a starting point to get a better understanding of the notation of category theory?
 A: You raise a good point. It is is actually standard to define the morphisms of $\mathbf{Set}$ to be ordered triples $(f,A,B)$ where $f$ is a function from $A$ to $B$, which solves this issue.
A: Here is the bigger picture.
It is important in category theory that every morphism $f$ has a well-defined domain $\mathrm{dom}(f)$ as well as a well-defined codomain $\mathrm{cod}(f)$. When you define a category as a tuple consisting of two (large) sets $\mathrm{Ob}(\mathcal{C})$, $\mathrm{Mor}(\mathcal{C})$ and functions $\mathrm{dom},\mathrm{cod} : \mathrm{Mor}(\mathcal{C}) \to \mathrm{Ob}(\mathcal{C})$ as well as identity and composition (these are not important here, all what I say applies equally to directed multigraphs) this holds by definition.
However, another way of defining categories is by giving $\mathrm{Ob}(\mathcal{C})$ and a function which associates to every pair of objects $A,B \in \mathrm{Ob}(\mathcal{C})$ a set $\mathrm{Hom}(A,B)$. In order to get a category as defined above, we define $\mathrm{Mor}(\mathcal{C})$ as the disjoint union of these sets, i.e. as
$$\mathrm{Mor}(\mathcal{C}) := \bigcup_{(A,B) \in \mathrm{Ob}(\mathcal{C})^2} \mathrm{Hom}(A,B) \times \{(A,B)\}.$$
Conversely, given $\mathrm{Mor}(\mathcal{C})$, we define $\mathrm{Hom}(A,B) := \{f \in \mathrm{Mor}(\mathcal{C}) : \mathrm{dom}(f)=A,\, \mathrm{cod}(f)=B\}$.
These constructions are inverse to each other, but only in a certain sense: $\mathrm{Mor}(\mathcal{C})$ is only isomorphic to the disjoint union of its Hom-sets, and conversely each Hom-set is isomorphic to the set of morphisms with given domain and codomain. It is not true that they are equal, but of course this does not matter at all in mathematical practice. When we start with $\mathrm{Mor}(\mathcal{C})$, the Hom-sets will be disjoint, but this is not true for other other approach.
Generally speaking, if we have a family of sets $(X_i)_{i \in I}$, their disjoint union $X := \coprod_{i \in I} X_i$ does not have the $X_i$ as subsets in the traditional sense of ZFC, but there are only injections $X_i \to X$. The images of the $X_i$ are disjoint, but the $X_i$ themselves are not in general.
But we have to ask ourselves the following question: does it actually make sense to ask if two abstract sets $X,Y$ are disjoint or not? Of course this is a very meaningful question if $X,Y$ are both subsets of a given set, but when there is no relation between $X$ and $Y$, what does it even mean that an element of $X$ is equal to an element of $Y$? All this works fine with ZFC where everything is a set and we have intersections and unions of all pairs of sets, but it enables us also to ask nonsense questions such as "Is the set of transcendental numbers disjoint to the set of smooth plane curves?". As you, see this is a "type error". This is fixed by structural set theories such as ETCS and even more by type theoretic foundations such as HoTT.
In structural set theories, there is no way of even saying that two random sets are disjoint or not. (We can say that two morphisms $A \to X$, $B \to X$ are disjoint, namely $A \times_X B = 0$.) In other words, the whole problem asked here just does not exist. And that being said, it also does not exist in mathematical practice. The reason is that almost all meaningful statements in category theory not involve "loose" morphisms without any known domain or codomain, but rather morphisms with a given domain and codomain. Secondly, we should never compare two morphisms $f : A \to B$ and $g : A' \to B'$ unless it is known that $A = A'$ and $B = B'$. If we want to do that, we should use commutative squares instead.
I hope all this explains a bit more David's comment above, saying "Disjointness of homs is irrelevant".
