Given a set $A$ with $n$ elements and $B = \{A_1,A_2,...,A_n\} ⊆ 2^A$. Prove that there exists an injective mapping $f : B → A$ such that $f(A_i) ∈ A_i$ for all $i ∈ \{1,2,...,n\}$ if and only if for all I ⊆ {1, 2, . . . , n} the cardinality of $\bigcup\limits_{i∈I}^{} A_i$ is at least equal to the cardinality of $I$.
I am not sure how to solve this one.