You should use an arbitary index set if you want an arbitrary union: suppose $A_i, i \in I$ is a family of open sets (in a metric space, I see from your proof attempt). Using the definition
$$O \text{ is open iff } \forall x \in O: \exists r>0 : B_r(x) \subseteq O\text{,}$$
as you seem to be doing.
To see $A = \bigcup_i A_i$ is open, we take any $x \in A$. By the definition of union, there exists some $i_0 \in I$: $x \in A_{i_0}$.
As $A_{i_0}$ is open and $x \in A_{i_0}$ we have some $r >0$ such that
$$B_r(x) \subseteq A_{i_0} \subseteq \bigcup_{i \in I} A_i = A$$
where the last statement is a set theory triviality (any set in a union is a subset of the union). So we have shown indeed that for any $x \in A$ we have this ball $B_r(x)$ with $B_r(x) \subseteq A$ (we just re-use the one we get for free from $A_{i_0}$ being open). So $A$ is open by definition.