Let $(G,*)$ be a group. Let $\sim$ be an equivalence relation such that $$(\forall a,a',b,b'\in G)a\sim a', b\sim b' \Rightarrow a*b\sim a'*b'. \tag{*}$$ I.e., the equivalence relation $\sim$ respects the group operation.
Question. Does the condition $(*)$ necessarily imply that $$(\forall a,b\in G) a\sim b \Rightarrow a^{-1}\sim b^{-1}, \tag{**}$$ i.e., the relation $\sim$ behaves well w.r.t. the inverses? (If yes, how can we prove this? If it is not true, what are some counterexamples?)
This can be expressed also using the corresponding partition. The condition $(*)$ means that $$[a]=[a'], [b]=[b'] \Rightarrow [a*b]=[a'*b'].$$ In the other words, we get a well-defined binary operation on the corresponding partition $G/\sim$. It is easy to see that in this way we get a monoid.
The condition $(**)$ says that the assignment $[a]\mapsto [a^{-1}]$ is also well-defined (=does not depend on the choice of the representative). So if $(**)$ is true, we have also inverses in $G/\sim$ and we get a group.
In several places I have seen mentioned in passing that if an equivalence relation fulfills $(*)$, the condition $(**)$ is true as well. For example, this is mentioned in the Wikipedia article Congruence relation (current revision). The definition there includes this condition, but the article mentions that "this can actually be proven from the other four, so is strictly redundant".
Similarly, if I checked Hungerford's Algebra (proof of Theorem 1.5 on page 27) or Jacobson's Basic Algebra I (Definition 1.4 on page 54 and the comments following this definition), they both define congruence only using $(*)$, but in the proof that we get a group they implicitly use that inverse is well-defined. (To make the question self-contained, I have copied the relevant parts from Jacobson's book below.)
This is how this is presented in Jacobson's book:
Definition 1.4. Let $(M,\cdot,1)$ be a monoid. A congruence (or congruence relation) $\equiv$ in $M$ is an equivalence relation in $M$ such that for any $a$, $a'$, $b$, $b'$ such that $a\equiv a'$ and $b\equiv b'$ on has $ab\equiv a'b'$. (In other words, congruences are equivalence relations which can be multiplied.)
After this definition, there is the definition of quotient monoid and an explanation why it actually is a monoid. For groups, the author mentions:
We can say a good deal more if $M=G$ is a group and $\equiv$ is a congruence on $G$. In the first place, in this case the quotient monoid $(\overline G,\cdot,\overline 1)$ is a group, since $\overline a\overline{a^{-1}}=\overline 1=\overline{a^{-1}}\overline a$. Hence every $\overline a$ is invertible and its inverse is $\overline{a^{-1}}$.
After this, the author proceeds to explain relationship between group congruences and normal subgroups.