# Prove that $\sup(\bigcup_{i \in I} A_i) = \sup\{\sup{A_i}\mid i \in I\}$

Assume $A_i$ is a nonempty subset of $\mathbb{R}$ for all $i \in I$. Prove that $$\sup\left(\bigcup_{i \in I} A_i\right) = \sup\{\sup{A_i}\mid i \in I\} \text{ and } \inf\left(\bigcup_{i \in I} A_i\right) = \inf\{\inf{A_i}\mid i \in I\}.$$

Attempt:

Assume without loss of generality that $\sup\{\sup{A_i}\mid i \in I\}$ is in $A_j$. Then, since the LHS contains $A_j$, it also contains the point in $A_j$ which yields the supremum of the supremums. A similar argument can be used for the infimums.

The supremum might not be attained, i.e., it might not actually be in any of the $A_i$'s.
Let $a=\sup\left(\bigcup_{i \in I} A_i \right)$, and let $a_i=\sup A_i$ for each $i \in I$. As $a$ is an upper bound for $\bigcup_{i \in I} A_i$, it is an upper bound for each $A_i$. Can you show that $a$ is an upper bound for $\{a_i \mid i \in I\}$? (Hint: use the fact that $a_i$ is the least upper bound of $A_i$.)
What you actually want to show is that $a$ is the least upper bound of $\{a_i \mid i \in I\}$. So suppose $b$ is another upper bound for $\{a_i \mid i\in I\}$, with the aim of showing $a\leq b$. Can you show that $b$ is an upper bound for $\bigcup_{i \in I} A_i$? Then use the fact that $a$ is the least upper bound of that set to conclude $a \leq b$.
Since $A_{i}$ is contained in $\cup_{i\in I}A_i$ for each $i$, $\sup\{A_i\}\leq \sup\{\cup_{i\in I}A_i\}$ for each $i$. Taking the supremum,we get that $\sup_{i\in I}\{\sup A_i\}\leq \sup\{\cup_{i\in I}A_i\}$. Now suppose this inequality was strict. then there exists $x \in \cup_{i\in I}A_i$ such that $x>\sup A_i$ for all $i$. But for some $j\in I$, $x \in A_j$, since $x$ belongs to their union. So $\sup A_j\geq x> \sup\{\sup A_i | i\in I\}\geq \sup A_j$: a contradiction, hence $\sup_{i\in I}\{\sup A_i\}\geq \sup\{\cup_{i\in I}A_i\}$. A similar argument holds for the $\inf$