Let $A = {1, 2, 3, 4, 5}$. Find the number of functions $f$ from the nonempty subsets of $A$ to $A$, such that $f(B) \in B$ for any $B \subset A$, and $f(B \cup C)$ is either $f(B)$ or $f(C)$ for any $B$, $C \subset A$
1. **Define the problem and notation:**
   Let \( A = \{1, 2, 3, 4, 5\} \). We need to find the number of functions \( f \) from the nonempty subsets of \( A \) to \( A \) such that:
   - \( f(B) \in B \) for any nonempty subset \( B \subseteq A \).
   - \( f(B \cup C) \) is either \( f(B) \) or \( f(C) \) for any subsets \( B, C \subseteq A \).

2. **Initial function value:**
   Let \( f(A) = a_1 \). By the condition \( f(B \cup C) \) is either \( f(B) \) or \( f(C) \), and since \( A \) is the union of any subset \( B \) containing \( a_1 \) and its complement, we have \( f(B) = a_1 \) for all \( B \) such that \( a_1 \in B \).

3. **Next function value:**
   Consider the subset \( A \setminus \{a_1\} \). Let \( f(A \setminus \{a_1\}) = a_2 \). By similar reasoning, \( f(B) = a_2 \) for all \( B \) such that \( a_2 \in B \) and \( a_1 \notin B \).

4. **Continue the process:**
   Continue this process iteratively. Let \( f(A \setminus \{a_1, a_2, \ldots, a_{k-1}\}) = a_k \). Then \( f(B) = a_k \) for all \( B \) such that \( a_k \in B \) and \( a_1, a_2, \ldots, a_{k-1} \notin B \).

5. **Termination of the process:**
   This process continues until \( k = n \), where \( n = 5 \) in this case. The elements \( a_1, a_2, \ldots, a_n \) are all distinct by construction, so they form a permutation of \( \{1, 2, 3, 4, 5\} \).

6. **Counting the permutations:**
   Since each \( a_i \) is distinct and forms a permutation of \( \{1, 2, 3, 4, 5\} \), the number of such functions \( f \) is the number of permutations of \( \{1, 2, 3, 4, 5\} \), which is \( 5! \).

\[
5! = 5 \times 4 \times 3 \times 2 \times 1 = 120
\]

Conclusion:
\[
\boxed{120}
\]