Is a morphism necessarily an identity when it is a function whose domain and image are the same set/object?
i.e. $f:A \rightarrow A$ where $f(A) = A$ and say $h(A)=B$ and $g(C)=A$, so then $h(f(A))=B=h(A)$ and $f(g(C))=A=g(C)$
It's not, right? And if so, what explicitly is sufficient to make a morphism from an object to itself in any category?
Do the equations that I wrote fulfill the axioms $id_x \circ g = g$ and $h \circ id_x = h$? If not, please let me know how. If so, please let me know what is missing that needs to be fulfilled.
Edit: Let me phrase it this way.
I know that an function that maps its domain bijectively is not necessarily an identity function. I know that any nontrivial permutation would make it not an identity function.
But, what in category theory is violated or says that it is not necessarily an identity as a morphism between the domain and itself as an object?
Update: Sorry. I was very sleep-deprived yesterday. Something about working with sets as objects now messed me up.
I started looking at a morphism/function from an object/set to itself that was bijective and started think about whether it is an identity morphism. I somehow lost sight of thinking about it being an identity with respect to the composition operator.
I was thinking about it returning the same object/set bijectively as the target/image (equaling the codomain vs a proper subset), meaning I was stuck on thinking about “identity” the way you think about an identity function returning the same set while just obeying the composition equations but only as acting on the object/set. But, an identity function returns the same set and each individual element identically, and in the category theory books that I’ve worked in, we don’t look at what is contained in the objects. That is where I thought my confusion was.
But, I should not have been looking at the composition equations as equating their images. It is the morphisms/functions themselves I should have been equating. And, had I just thought about multiple arrows/morphism going with the same source and target, that probably would have snapped me out of it. Anyway, I hope this will help someone else who has this same sort of brainfart. If anyone has advice on how to better make sure this accomplishes that, please let me know.
I gave upvotes to those who tried to help figure out what my confusion was. It is not appropriate to mark one of the answers as the official answer, right? If someone wants to make what I wrote more reader friendly, I should mark that as the official answer, right?
No. Consider $f : \{1,2 \} \to \{1,2\}$ in the category of sets. If $f(1) = 2, f(2) = 1$, $f$ has domain and image of $\{1,2\}$, but is not an identity.
It is not entirely clear what is meant by this, since, whenever you know something is a category, every object in it automatically is known to have an identity morphism. If you mean insofar as determining whether a given collection of objects/morphisms constitutes a category - and in specific each object has an identity - it just somewhat ... depends, really. The kinds of objects you can encompass in category theory are far too diverse, in my opinion, to give a conclusive listing of various properties that would imply the existence of identity without finding it outright, since some categories are just very pathological and strange in nature -- though you might be able to use certain properties of categories in general to conclude identities exist, but that's circular and more effort than needed since it would assume the existence of the category in the first place (and thus identities).
In short, I think this sort of question is too broad and vague to really get you any sort of meaningful answer.