Opalg said:
Let $\mathcal{F}$ be the set of bijective maps of the form $f: D(f)\to R(f)$ with domain $D(f)\subseteq X$ and range $R(f)\subseteq Y$, made into a partially ordered set by the relation $f\prec g\; \Longleftrightarrow\; \{D(f)\subset D(g) \text{ and } g(x) = f(x)\; \forall x\in D(f)\}$. Show that $\mathcal{F}$ satisfies the conditions for Zorn's Lemma, and then check that a maximal element is either an injection from $X$ to $Y$ or the inverse of an injection from $Y$ to $X$.
I started out this way myself but I could not complete the proof. May be I am missing something simple. Here's my proof:
Let $\mathcal C$ be the collection of all ordered triples $(A,B,f)$ such that $A\subseteq X, B\subseteq Y$ and that $f$ is an injection from $A$ to $B$. We order $\mathcal C$ in the folloewing way. Let $(A_1,B_1,f_1)$ and $(A_2,B_2,f_2)$ be two elements of $\mathcal C$. Then we write $(A_1,B_1,f_1)\leq(A_2,B_2,f_2)$ if $A_1\subseteq A_2$, $B_1\subseteq B_2$ and the restriction of $f_2$ to $A_1$ is same as $f_1$. Now let $C=\{(A_\alpha,B_\alpha,f_\alpha)\}_{\alpha\in J}$ be any chain in $\mathcal C$, where $J$ is an index set. Define $A=\bigcup_{\alpha\in J}A_\alpha$ and $B=\bigcup_{\alpha\in J}B_\alpha$. Consider a function $f:A\to B$ defined as $f(a)=f_\alpha(a)$ if $a\in A_\alpha$.
Claim 1: $f$ is well defined.
Proof: Let $a\in A$ be such that $a\in A_\alpha$ and $a\in A_\beta$. We need to show that $f_\alpha(a)=f_\beta(a)$. Since $C$ is a chian, WLOG assume that $A_\alpha\subseteq A_\beta$. Then the restriction of $f_\beta$ to $A_\alpha$ is same as $f_\alpha$. Thus $f_\beta(a)=f_\alpha(a)$ and the claim is settled.
Claim 2: $(A,B,f)$ is in $\mathcal C$.
Proof: Clearly $A\subseteq X$ and $B\subseteq Y$. We just need to show that $f$ is an injection. Let $f(p)=f(q)$ for some $p,q\in A$. Say $p\in A_\gamma$ and $q\in A_\delta$. WLOG assume that $A_\gamma\subseteq A_\delta$. Then $f(p)=f_\delta(p)=f_\delta(q)\Rightarrow p=q$ by the injectivity of $f_\delta$.
Claim 3: $(A,B,f)$ is an upper bound of $C$.
Proof: Let $(A_\alpha,B_\alpha,f_\alpha)$ be any element of $C$. Clearly $A_\alpha\subseteq A$ and $B_\alpha\subseteq B$. We need to show that the restriction of $f$ to $A_\alpha$ is same as $f_\alpha$. But this is evident by the definition of $f$ and hecne the claim is settled.
Now by Zorn's Lemma, $\mathcal C$ has a maximal element.
Say the maximal element is $(A_0,B_0,f_0)$. If $A_0=X$ then we are done. So assume $A_0\neq X$. Now if $B_0\neq Y$ then we can easily find an element in $\mathcal C$ which is greater than $(A_0,B_0,f_0)$ and we would run into a contradiction. Thus $B_0=Y$. From here its not easy to see that $f_0^{-1}:Y\to X$ is an injection and the proof is complete.