There are indeed examples (and nontrivial examples at that) in which identity elements do not commute. In particular the first that comes to mind is for left and right inverses of linear transformations on infinite dimensional vector spaces. For example:
Consider the linear transformation that maps infinite sequences of real numbers (a1, a2, a3, ...) to the vector (a2, a3, a4, ...)
You can verify that this is in fact a linear operator however the left sided inverse of this operator does not exist (namely because given (a2, a3, a4...) it is impossible to recover the a1 that was lost when performing the operation).
However this operator certainly has a right inverse, namely (a1, a2, a3,...) maps to (k, a1, a2, a3,...)
You can verify that this is a right inverse.
Other specific examples are the square root function, and integration/differentiation. In both of these cases one direction has a left/right inverse and the other direction does not have any inverse, or does not have the same inverse. Thus the identity is not commutative.
In particular this commonly happens for transformations that are one to one but not onto, or vice versa. From this it follows that these require infinite dimensional vector spaces.