I want to show that the square of the supremum of any set of non-negative numbers is the supremum of the squares. I.e. of $A\subseteq \mathbb{R}^+$ then \begin{equation*} \sup_{a\in A} a^2 = \left( \sup_{a\in A}a\right)^2 \end{equation*} This is obvious if the supremum is actually attained (so it is the maximum). However, I am struggling to prove it rigorously for the case that the maximum is actually not attained. Could show this carefully?
Thanks
In case you want to show this rigorously, you will need to show that $\sup \{a^2\} \leq (\sup \{a\})^2$ and vice-versa.
To show one direction, note that $\sup \{a\} \geq a$ for all $a$, hence $(\sup \{a\})^2 \geq a^2$ for all $a$, so $(\sup \{a\})^2$ is an upper bound for $\{a^2\}$, hence it is greater than the least upper bound, i.e. $(\sup\{a\})^2 \geq \sup\{a^2\}$.
To show the other direction, let $N$ be large enough such that $\sup \{a\} - \frac 1N > 0$ (if $\sup \{a\} = 0$ and all $a$ are non-negative, then it is clear what the set is and the result itself). Now for any $n>N$, the quantity $\sup \{a\} - \frac 1n$ is not an upper bound of $\{a\}$, Hence, there is some $a_n$ such that $a_n > \sup\{a\} - \frac 1n$. Square both sides(note that by non-negativity of both sides, this preserves sign) to see that $a_n^2 > \frac 1{n^2} + (\sup \{a\})^2 - \frac{2\sup \{a\}}{n}$. Now, by definition of supremum, we have $$\sup \{a^2\} \geq a_n^2 > \frac 1{n^2} + (\sup \{a\})^2 - \frac{2\sup \{a\}}{n}$$
This applies for all $n>N$. Since $(\sup \{a\})^2$ is a bounded quantity, letting $n \to \infty$, we see that $\sup \{a^2\} \geq (\sup \{a\})^2$. Hence, equality follows.
Note the trick played in the second half of the proof. You will need to use it repeatedly and become comfortable with it.