# If $f$ is bijective then show it has a unique inverse $g$

Given a function $f:X\rightarrow Y$, an inverse function $g$ of $f$ is a function from $Y$ into $X$ such that $\left ( f(g(y)) \right )=y$ for all $y \in Y$. I have to show that $g$ is a unique inverse function of $f$ if $f$ is bijective.

My attempt: Since $f$ is bijective, we know that there exists a $y \in Y$ with $f(y)=x$ for every $x \in X$ (from surjectivity). Furthermore, there is only one such $y$ such that $f(y)=x$ since $f$ is injective as well.

Let $g(x)=y$. Then $g(f(y))=y$ for any $y$ and $f(g(y))=x$ for any $x$. So $g$ is an inverse of $f$.

To show that $g$ is unique, suppose for contradiction, $f$ has another inverse $h$. Also suppose $g \neq h$. Then there would be some $x$ for which $g(x) \neq h(x)$. However, this $x$ must be $f(y)$ for some $y \in Y$.

Since $g$ is an inverse of $f$, we must have $g(x) = g(f(y))=y$.

Similarly, $h(x)=y$.

Therefore, there is no $x$ such that $g(x) \neq h(x)$.

So $g$ is unique.

Does this proof seem correct?

• You say 'we know that there exists a $y \in Y$ with $f(y)=x$ for every $x \in X$ (from surjectivity)'. You are completely confusing domain and codomain. – Gibbs Sep 16 '18 at 19:33
• Sorry, should be $f(x)=y$. Please let me know if there are any other issues or is it only the first paragraph? Many thanks. – OGC Sep 16 '18 at 19:59

Apart from the problem I remarked in my comment, your proof looks ok. There is an alternative way: assume $g,h$ are two inverse functions of $f$. Then for each $x \in Y$ you get $$g(x) = g(h^{-1}(h(x))) = g(f(h(x))) = h(x).$$
• Hmm interesting. Btw why do you say for each $x \in Y$? Do you mean for each $x \in X$? – OGC Sep 16 '18 at 20:04
• No, because $f \colon X \to Y$, and then $g,h\colon Y \to X$. So $x$ in my answer is an element of $Y$. – Gibbs Sep 16 '18 at 20:07