in an injection from A to B, do all elements from A have to be used? all the definitions I see of injection mention that each element from B is mapped to at most once by elements from A, but they do not mention whether all the elements from A must have some mapping to another element from B. In other words, if in the image attached (3) did not map to any element in Y, would this still be an injection?
image
 A: In most contexts, function are by their very nature assumed to be total, i.e. it is assumed that 
$$\forall a \in A \ \exists b \in B \ f(a)=b$$
If this were not true, it would not be considered a 'function' in the first place. Indeed, a binary relation with this property is said to be functional, and if it lacks the property, it is not 'functional'.
That said, there are contexts (e.g. computability theory) where we want to talk about 'partial functions', for which this property does not hold (but we still regard it as a function ... just not a total function but a partial function).
So, the context should make it clear what is going on, though I would say that injectivity is merely:
$$\forall a_1 \in A \ \forall a_2 \in A \ (f(a_1) = f(a_2) \rightarrow a_1 = a_2)$$
so the property of being injective does not include or imply totality or functionality .. Again, that would be implied (in most contexts) by it being a function in the first place.
And so yes, if (3) would not map to anything, it would still be injective, but it may no longer be considered a function ... it would merely be a binary injective relation.
A: $f:A\to B $ is injective $\iff $


*

*$ \forall a\in A \;\;f (a) $ exists in B.

*$\forall (a_1,a_2)\in A^2 $
$$(f (a_1)=f (a_2)\implies a_1=a_2) $$
two different elements of A  must have two different images in B.
