Prove that if an inverse function exists, then it is unique.

If $a$ and $b$ are both inverse functions of $f$, then:

$$a \circ f= f \circ a = Id$$ $$b \circ f= f \circ b = Id$$

Therefore,

$$f \circ a= f \circ b $$

Composing by left side,

$$a \circ (f \circ a)=a \circ (f \circ b) $$

By associativity

$$(a \circ f) \circ a=(a \circ f) \circ b $$

Since $a \circ f= Id$, then $$Id \circ a = Id \circ b$$

which means

$$a=b$$


Can't you go with contradiction in the following sense?

Let $f:A\rightarrow B$, and $g:B\rightarrow A$ and $h:B\rightarrow A$ both be the inverses of $f$. Assume $g\neq h$. Then, there is $b\in B$ such that $g(b)\neq h(b)$.

As $f$ is bijective, then for all $b\in B$ there is $a\in A$ such that $f(a)=b$. As both, $g$ and $h$ are inverse functions of $f$, then it must hold that $g(f(a))=a$ and $h(f(a))=a$, but $f(a)=b$, so we have $g(b)=a=h(b)$, which contradicts our hypothesis.