What you're trying to prove is simply not true. First of all a function from $A$ to $B$ does not have to be injective and surjective. Take for example the set's in your example and have $f:A\to B$ such that $f(1)=f(4)=2$, clearly not injective or surjective.
Also it's possible for an injection to not be surjective and a surjection to be not injective. For the first case just take the mapping from $\mathbb Z$ to $\mathbb R$ such that $f(x) = x$, clearly an injection that is not a surjection. The other way around from $\mathbb Z$ to $\mathbb N$ such that $f(n) = |n|$, a surjection that's not injective.
What you could try to prove is that for finite sets with the same cardinality that a map $f:A\to B$ is injective is equvialent to it being surjective.
But if a mapping $f:A\to B$ is injective we have that $|A| \le |f(A)|$, but $f(A)\subseteq B$ so $|f(A)|\le|B|$ so we have:
$$|A| \le |f(A)| \le |B| = |A|$$
And since $|f(A)| = |B|$, $f(A)\subseteq B$ and $B$ is finite we must have that $f(A) = B$, that is $f$ is surjective.
The opposite is proved in similar way.