TITLE: Prove that if an inverse function exists, then it is unique.
QUESTION [6 upvotes]: I have been trying to solve this proof for some time in preparation for a test, though I'm not sure if I am going about this the correct way.
Prove that if an inverse function exists, then it is unique.

I am attempting proof by contradiction.
Let $f$ be a function, with an inverse.
Let $a$ be an inverse of $f$.
Let $b$ also be an inverse of $f$.
$$f\circ a = x$$
$$f\circ b = x$$
$$(f\circ b)(f\circ a)  = x(f\circ a)$$
$$(f\circ b)x  = x(f\circ a)$$
$$(f\circ b)  = (f\circ a)$$
because $(f\circ b) = x$ and $(f\circ a) = x$, $a = b$, thus proving that if an inverse of $f$ exists, it is then unique.
I'm not sure why, but something feels a bit off with my reasoning, or at least the way I have explained it.
If anyone could shed some light on a better way for me to explain this, I would greatly appreciate it.

REPLY [4 votes]: 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.