I am aware there are great answers in
Inverse of a Function exists iff Function is bijective
I was wondering if I could do this proof directly.
My plan is to prove the given statement for all relations (because to me arbitrary relations seem nicer than actual functions), so that it holds for functions as well. Like so,
Let $R \subseteq A\times B$ be a relation. Assume its inverse relation $R^{-1}$ is a function. Suppose $a_1 R b$ and $a_2Rb$. Then by definition of inverse relations, $bR^{-1}a_1$ and $bR^{-1}a_2$. Since $R^{-1}$ is a function, $b$ must have a unique image under $R^{-1}$ meaning $a_1 = a_2$. This proof would've worked if $R$ was a function.
Since the plan above failed(?), I will try to adopt the general idea to a proof where $R$ is a function. So,
Consider the function $f: A \to B$. Let $f^{-1}$ be a function. Suppose $f(a_1) = f(a_2) = y \in B$. Since $f$ is a relation, I can use the notation for relations and so $a_1fy$ and $a_2fy.$ By definition of inverse relations, $yf^{-1}a_1$ and $yf^{-1}a_2$. Since $f^{-1}$ is a function, $y$ must have a unique image under $f^{-1}$ meaning $a_1 = a_2$. This proof looks like it works, but I have never seen anyone argue like this or use this notation.
I'd be happy if the second proof works despite the fact it's ugly because it would mean everything I learned so far I understood correctly and I am not going to show this to anyone (just for personal use). So, is the second proof in/correct? If incorrect, how can I fix it while keeping the main idea in place? Thanks.
edit: I want to prove "If $f : A \to B, g : B \to A$ are functions with $g \circ f = i_A$ and $f \circ g = i_B$, then $f, g$ are bijective and $g = f^{−1}$" from the original statement. I cannot assume this theorem.