TITLE: The projection on the first factor is a bijection
QUESTION [5 upvotes]: I require some clarification and hints on the following Problem:
\begin{align}f: X \longrightarrow Y \end{align}
The image $p$ is defined as: \begin{align} p: G_f &\longrightarrow X  \\ (x,y) &\longmapsto x\end{align}
With $G_f=\lbrace (x,y) \in X \times Y : f(x)=y \rbrace$
Question: Is the function $p$ a bijection?
The part I struggle the most with is that this is the first time that I deal with a 2-tuple, so please check if my approach is correct.
In the general case, to show if a function is injective choose $x,x' \in X$ such that $f(x)=f(x')$ and show that if $f(x)=f(x')$ then $x=x'$
Here is my approach to this problem: Let $(x,y) \in G_f \subset X \times Y$ and $(x',y') \in G_f \subset X \times Y$ be two 2-tuples such that $p(x,y)=x=p(x',y')$ then $(x,y)=(x',y')$ is an ordered pair, therefore $x=x'$ and $y=y'$
Is this correct? 
For surjectivity, no ideas so far.
Surjectivity: $ \forall y \in Y \exists x \in X : f(x)=y $

REPLY [2 votes]: Assume $p(x,y)=p(x',y')$. Then $x=x'$ and hence $(x',y')=(x,y')$.
This shows that $(x,y)$ and $(x,y')$ are points on $G_f$ and by definition
$$y=f(x) , y'=f(x) \,.$$
This shows that $y=y'$. 
P.S. In your proof, the part $p(x,y)=x=p(x'y')$ then $(x,y)=(x'y')$ is incomplete, that's exactly what you try to prove. $p(x,y)=x=p(x'y')$ only implies that $x=x'$, you need to also argue that $y=y'$, which is not hard.