Sorry for such a trivial question, but just wanted to check my understanding.
When proving a statement, for example, that the inverse of a group element is unique (in elementary group theory) one starts by supposing that there exists two inverses $h$ and $k$ for a given element $g \in G$, where $G$ is some group with binary operation $\ast:G\times G \rightarrow G$, such that $h\ast g = g\ast h = e$ and $k\ast g = g\ast k = e$ where $e \in G$ is the unique identity for the group $G$. From this, one can show that $h=k$ in the following manner: $$ h=h\ast e =h\ast\left( g\ast k\right) = \left(h\ast g\right)\ast k = e\ast k =k$$ and as such $h=k$. Now, is the reason we can from this state that the inverse of an element $g\in G$ is unique because $h$ and $k$ were chosen arbitrarily, apart from the requirement that they are inverses of $g$, and as such, if we know the value of one of the inverses, say $h$, then we know that for any other value $k$ to be an inverse of $g$ it must be equivalent to the known inverse $h$, and thus $h$ is the unique inverse of $g$. Is this reasoning correct?
Sorry for the wordiness of this question, but just wanted to check my understanding explicitly. Also, although I understand that, logically, I should have proven this first (but I'd already written out the inverses part before thinking of this, so apologies for that), but is the reasoning the same for arguing that the identity element of a group is unique? (i.e. If we assume that there are two identity elements $e,g \in G$ and subsequently show that $e=g$, then this implies that if we know the form of one of the identities, say $e$, then for any other value $g$ to be an identity of the group $G$ it must be equivalent to $e$ and thus the identity element of a group is unique).