[proofplan]
We prove equality by establishing both inequalities. The lower bound $\dim_{\mathcal{H}}(\bigcup_j E_j) \geq \sup_j \dim_{\mathcal{H}}(E_j)$ follows from monotonicity of Hausdorff dimension. The upper bound $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq \sup_j \dim_{\mathcal{H}}(E_j)$ follows from countable subadditivity of Hausdorff measure: for any $t > \sup_j \dim_{\mathcal{H}}(E_j)$, we have $\mathcal{H}^t(E_j) = 0$ for every $j$, hence $\mathcal{H}^t(\bigcup_j E_j) = 0$, so $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq t$.
[/proofplan]
[step:Prove the lower bound $\dim_{\mathcal{H}}(\bigcup_j E_j) \geq \sup_j \dim_{\mathcal{H}}(E_j)$ by monotonicity]
For each $k \in \mathbb{N}$, $E_k \subset \bigcup_{j=1}^\infty E_j$. By the monotonicity property of Hausdorff dimension — if $A \subset B$ then $\dim_{\mathcal{H}}(A) \leq \dim_{\mathcal{H}}(B)$, which follows from monotonicity of Hausdorff measure ($\mathcal{H}^s(A) \leq \mathcal{H}^s(B)$ for all $s \geq 0$) — we have
\begin{align*}
\dim_{\mathcal{H}}(E_k) \leq \dim_{\mathcal{H}}\!\left(\bigcup_{j=1}^\infty E_j\right) \quad \text{for every } k \geq 1.
\end{align*}
Taking the supremum over $k \geq 1$:
\begin{align*}
\sup_{j \geq 1} \dim_{\mathcal{H}}(E_j) \leq \dim_{\mathcal{H}}\!\left(\bigcup_{j=1}^\infty E_j\right).
\end{align*}
[/step]
[step:Prove the upper bound $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq \sup_j \dim_{\mathcal{H}}(E_j)$ via countable subadditivity]
Let $d = \sup_{j \geq 1} \dim_{\mathcal{H}}(E_j) \in [0, \infty]$. If $d = \infty$ (which can occur if $n = \infty$, but in $\mathbb{R}^n$ we have $d \leq n$), the inequality $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq d = \infty$ holds vacuously. So assume $d < \infty$.
Fix any $t > d$. For each $j \geq 1$, the definition $\dim_{\mathcal{H}}(E_j) \leq d < t$ means $\mathcal{H}^t(E_j) = 0$. (Recall: if $s > \dim_{\mathcal{H}}(E_j)$, then $\mathcal{H}^s(E_j) = 0$ by the definition of Hausdorff dimension as the infimum of exponents giving zero measure.)
By countable subadditivity of $\mathcal{H}^t$ (which holds because $\mathcal{H}^t$ is an outer measure, as established in [$\mathcal{H}^s$ is a Borel Regular Outer Measure](/theorems/3044)):
\begin{align*}
\mathcal{H}^t\!\left(\bigcup_{j=1}^\infty E_j\right) \leq \sum_{j=1}^\infty \mathcal{H}^t(E_j) = \sum_{j=1}^\infty 0 = 0.
\end{align*}
Since $\mathcal{H}^t(\bigcup_j E_j) = 0$, the definition of Hausdorff dimension gives $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq t$.
[/step]
[step:Take $t \to d^+$ and combine the two bounds]
The bound $\dim_{\mathcal{H}}(\bigcup_j E_j) \leq t$ holds for every $t > d$. Since $\dim_{\mathcal{H}}(\bigcup_j E_j)$ is a fixed real number (or $+\infty$), taking the infimum over all $t > d$ gives
\begin{align*}
\dim_{\mathcal{H}}\!\left(\bigcup_{j=1}^\infty E_j\right) \leq \inf_{t > d} t = d = \sup_{j \geq 1} \dim_{\mathcal{H}}(E_j).
\end{align*}
Combining with the lower bound from the first step:
\begin{align*}
\dim_{\mathcal{H}}\!\left(\bigcup_{j=1}^\infty E_j\right) = \sup_{j \geq 1} \dim_{\mathcal{H}}(E_j).
\end{align*}
[/step]