If one of two sets has larger cardinality, there is a map onto the other set 
Let A and B be sets with the cardinality of A less than or equal to B. Show there exists an onto map from B to A.

I am struggling with this proof. I don't know how to show this. Any help would be greatly appreciated

A not empty
There exists an injective map $f:A\rightarrow B$, there exists an inverse $g:f(A)\rightarrow A$. Let $a\in A$, $h:B\rightarrow A$ defined by $h(x)= g(x), x\in f(A)$ otherwise $h(x)= a$
