This function takes in a finite subset of $\mathbb{Z}$ and outputs its cardinality. For instance,
$$h(\{-2,0,5\}) = 3, \quad h(\emptyset) = 0, \quad h(\{1,2,\dots,n\}) = n.$$
To show that this function is not injective, it suffices to find two different finite subsets of $\mathbb{Z}$, $A \neq B$, such that $h(A)=h(B)$. That is, $|A|=|B|$. Non-injectivity means the doman of $h$ is too big - there are too many sets that map to the same value. So to fix this, you want to restrict the domain of $h$ so that there is at most one set of any given size.
To show that this function is not surjective, it suffices to find an integer $z$ such that there is no finite subset $A \subseteq \mathbb{Z}$ with $f(A)=|A|=z$. (Hint: The cardinality of a finite set is always nonnegative.) Non-surjectivity means that the codomain of $h$ is too big - there are elements in the codomain that are not mapped to by any element in the domain. To fix this, you need to restrict the codomain so that each element has a corresponding finite subset of $\mathbb{Z}$ in the domain of that size.