all functions $f:A \rightarrow Y$ can be extended to $F$ if $i$ is injective. 
Given sets $A, X, Y$ and functions $i: A \rightarrow X$. We say that $f:A \rightarrow Y$ extends to $F:X \rightarrow Y$ if for all $a \in A$ $$F(i(a)) = f(a)$$

We want to show that all functions $f:A \rightarrow Y$ can be extended to $F$ if $i$ is injective.
$i$ being injective has the consequence as all $a \in A$ are mapped to distinct $X \in X$. So the image set of $i$ contains some distinct subset of $X$. I believe I have to break this up into three cases namely $f$ being surjective, injective. (I don't think I have to consider the bijective case since bijection is injective + surjective)
Case $1$: when $f$ is injective.
$\Rightarrow$ If $f$ is injective then it maps all $a \in A$ to distinct $y \in Y$ hence the $F$ exists.
Case $2$: When $f$ is surjective $$$$$\Rightarrow$When $f$ is surjective it has the property that for every $y \in Y$ there is a $a \in A$ such that $f(a) = y$
So if there exists $a_1 \neq a_2 \in A$ such that $f(a_1) = f(a_2) = y_0$ (because elsewise it's the same thing as the earlier case.)
But since $a_1,a_2$ are mapped to $x \in X$ for some $x_1,x_2$ by $i$, $F$ can map them both to $y_0$ hence such a $F$ exists
Is this proof correct? Are there different (and easier) ways to prove this?
 A: There is a counterexample you have to consider: If $Y=\emptyset$, then $A=\emptyset$ as otherwise $f$ wouldn't exist. Take $X\neq\emptyset$, then $i\colon\emptyset\rightarrow X$ is injective, but there is no $F\colon X\rightarrow\emptyset$.
Now assume $Y\neq\emptyset$. You don't need to split your proof into two cases concering injectivity and surjectivity, you can do so with the image. You can also directly construct $F$: Let $x\in X$, then either $x\notin\operatorname{img}(i)$ or $x\in\operatorname{img}(i)$. For the former case, take an $y\in Y$ (which needs $Y\neq\emptyset$) and define $F(x)=y$. For the former case, take a preimage $a\in A$ and define $F(x)=f(a)$, which means $F(i(a))=f(a)$. (You need the axiom of choice for this proof.) Since every $a\in A$ appears as the preimage of a $x\in\operatorname{img}(i)$ and we have defined $F$ for every $x\in X$, we are done.
Considering your thought about injectivity and surjectivity, you have the following relations: Assume we have $F\circ i=f$. If $f$ is injective, then so is $i$ as $i(a)=i(a')\Rightarrow f(a)=F(i(a))=F(i(a'))=f(a')\Rightarrow a=a'$. If $f$ is surjective, then so is $F$ as for $y\in Y$ we have a preimage $a\in A$ under $f$ and therefore a preimage $i(a)\in X$ under $F$.
