The identity morphism in $\mathbf{Set}$ is the identity function

Okay, based on the extensive discussion in comments, it seems that you want to consider the following:

Suppose that we have a well-defined collection of sets, which we want to make into a category by letting them be the objects, taking the collection of morphisms to be all set-theoretic functions between the two sets, and using regular composition and domain/codomain identifications. Can we prove that under these circumstances, for us to have a category then the categorical identity arrow must be the identity function for the set?

The key is that you have enough functions to "separate points". Given any $a,b\in A$, $a\neq b$, there exists a function $g\colon A\to A$ such that $g(a)\neq g(b)$. For example, define $g$ to be the function that maps $b$ to $a$, and maps everything else to $b$. (Compare this with the example I gave in the comments, where this does not hold).

So, fix a set $A$, and suppose that $f\colon A\to A$ is the arrow that satisfies the identity conditions (for all objects $B$ and $C$, and all arrows $g\colon A\to B$ and $h\colon C\to A$, $gf = g$ and $fh = h$).

Pick any $a$ and $b$ in $A$, $a\neq b$. Let $g$ be a function with $g(a)\neq g(b)$; then $gf(a) = g(a)$, so it follows that $f(a)\neq b$. This holds for every $b\in A-\{a\}$, so the only possibility is that $f(a)=a$. This holds for all $a\in A$, so $f$ must be the identity map.

You can generalize this to any set-based category in which you can either separate points, or "hit" any point: if for every object $A$ and every elements $a,b\in A$ with $a\neq b$, there either exists an object $B$ and a morphism $h\in\mathcal{C}(A,B)$ such that $h(a)\neq h(b)$; or else there exists an object $C$, and a morphism $g\in\mathcal{C}(C,A)$ for which there exists an element $c\in C$ such that $g(c)=a$; then the identity morphism of $A$ must be the identity map of $A$.

Indeed, suppose that $f$ is the identity morphism, and let $a\in A$. For each $b\in A$, $b\neq a$, either we have $B$ and $h$ as above, and $hf(a) = h(a)$ implies that $f(a)\neq b$; or else there exists $C$, $c$ and $g$ as above with $g(c) = a$. Then $fg = g$ gives that $f(a)\neq b$ (since $f(g(c))=b$ and $g(c)=a$ implies $a=b$). Either way, you get that for all $b\in A$ with $b\neq a$, $f(a)\neq b$. So the only possibility left is that $f(a)=a$. This holds for all $a\in A$, so $f=1_A$.

Note. In a sense, the condition is both necessary and sufficient, though for silly reasons: if the condition is not met by $A$ and $a$, then the identity map of $A$ cannot be the identity morphism, simply because the identity map of $A$ satisfies the given conditions: for all $b\neq a$ you have $1_A(a)\neq 1_A(b)$, and $1_A(a)=a$.

Added. This argument applies to categories such as topological spaces (because you always have the map from the $1$-element topological space to your toplogical space mapping the unique point to $a$); pointed topological spaces (the discrete 2-element pointed topological space maps the non-distinguished point to your favorite point); groups (you have maps from the cyclic group to any group, mapping the generator to your element $a$); and others. It's hard to make it work with posets as categories, because posets as categories are not really set-based categories (the objects are not usually sets and arrows set-theoretic functions between them); you can model them as set-based categories, but then the result need not hold: the example I gave in the comments can be thought of as the totally ordered set with two elements, for example, and here you don't have $id_A = 1_A$.


I think the most you can say in general is that $\text{id}_A$ acts as the identity function on the hom-sets $\text{Hom}(B, A)$ for all $B$ in the category. That uniquely specifies it by the Yoneda lemma, so there's no ambiguity here, and it is the appropriate generalization of "acts as the identity on points of $A$" to arbitrary categories: you should think of it as "acts as the identity on generalized points of $A$."