So, a textbook I'm reading from defines a function as follows:
A function $f$ from a set $A$ to a set $B$ is the set $$\Gamma_f := \{(x,y)\in A \times B : y = f(x)\}$$ with the property that $\forall x \in A, \exists! y \in B$ such that $(x,y) \in \Gamma_f$
Now, I'm told to prove the following:
Let $f: A \to B$ be a bijection. Define $g: B \to A$ such that $g(y) = x$ precisely when $f(x) = y$. Show that $g$ is a function.
Proof Attempt: First, we wish to show that $$\Gamma_g = \{(y,x) \in B \times A: x = g(y)\}$$ is non-empty. Let $b \in B$. Since $f$ is surjective, there exists an element $a \in A$ such that $f(a) = b$. By the definition of $g$, we have $g(b) = a \implies (b,a) \in \Gamma_g$, so $\Gamma_g \neq \emptyset$.
Now, to show the uniqueness property, suppose $(b,a') \in \Gamma_g$. Then, by the definition of $\Gamma_g$, $a' = g(b)$ which means that $f(a') = b$. So, $f(a') = f(a)$. By the injectivity of $f$, it follows that $a' = a$. Hence, $(b,a') = (b,a)$. This completes the proof.
Is my proof correct? Did I show the right things? If not, what should I have shown and what is the correct way path I should have taken? Any advice would be appreciated.
Looks good to me, except that in order for $g$ to be a function, $\forall x\in B,\exists a\in A$ such that $g(b)=a$, that is, every $b\in B$ has an image in $A$. You have proved this in the first part of the proof by invoking the surjectivity of $f$, but labelled it as an attempt to show that $\Gamma_g$ is non-empty.