Initial elements in Set and identity By definition for every object there is at least one morphism - identity, so, there must be identity morphism for Set initial object - empty set. But no function can have empty set as codomain, so, how to define identity morphism in this case?

No function from a non-empty set to the empty set exists (clearly, since there is at least one input for the function, but no possible output). But, for every set $A$ there is precisely one function $f\colon \emptyset \to A$. This is equally clear, since there are now no inputs for the function so the function really does not need to do anything, and it does not care how many (if any) outputs are possible. In particular, there is a unique function $\emptyset \to \emptyset$. Formally, it is the empty relation $\emptyset \subseteq \emptyset \times \emptyset$. In other words: $\emptyset ^ \emptyset=\{\emptyset\}$.
