Problem requiring Zorn's lemma 
Let $R$ be a relation from $A$ to $B$ and let the domain of $R$ be $A$. Use Zorn’s Lemma to show that there is a subset $f$ of $R$ such that $f$ is a function from $A$ into $B$.

I am having trouble finding where to apply Zorn's Lemma in this problem.
 A: Let $A,B$ be nonempty sets, $R$ be a relation between $A$ and $B$ and let
$$\mathcal{F}=\{f\in S\times B|\;f\text{ is a function }, f\subseteq R\;\&\; S\subseteq A\}$$
Then, clearly $\mathcal{F}\not=\emptyset$, since $R$ is nonempty. Let $C$ be a chain of the partially ordered set $\langle\mathcal{F},\subset_{\mathcal{F}}\rangle$, where $\subset_{\mathcal{F}}$ is the strict inclusion relation in $\mathcal{F}$. Then $C$ has an upper bound in $\langle\mathcal{F},\subset_{\mathcal{F}}\rangle$. To see this, let $h=\bigcup C$. Clearly, $h$ is a function of domain a subset of the domain of $R$, namely $\text{dom}(h)=\bigcup\{\text{dom}(f)|f\in C\}$ and image a subset of $B$.
By Zorn's lemma, there is a maximal element in $\langle\mathcal{F},\subset_{\mathcal{F}}\rangle$, which we shall denote simply by $f$.
On the one hand, $f$ is a function of domain a subset of the domain of $R$, since it is an element if $\mathcal{F}$. On the other hand, it is clear that if $a\in \text{dom}R\setminus\text{dom}(f)$, then, since $R$ is a relation by hypotheses, choosing an element $b\in B$, such that $\langle a,b\rangle\in R$, $f\cup\{\langle a,b\rangle\}$ is a function of domain $\text{dom}(f)\cup\{a\}$, which is absurd, since it contradicts the fact that $f$ is maximal in $\langle\mathcal{F}, \subset_{\mathcal{F}}\rangle$.
