Let's use the following definition of closure:
Let $A$ be a subset of $(X,\tau)$. Then the set $A \cup A'$, consisting of the set $A$ and all it's limit points it's called the closure of $A$ and is denoted by $\overline A$.
So, we want to prove that $\overline{(A_1 \cup A_2)} = \overline A_1 \cup \overline A_2$.
Part 1
Let's start by proving that $\overline{(A_1 \cup A_2)} \subseteq \overline A_1 \cup \overline A_2$.
Let $x \in \overline{(A_1 \cup A_2)}$, Then we have that $x \in (A_1 \cup A_2) \cup (A_1 \cup A_2)'$ (this is the definition of closure).
If $x \in (A_1 \cup A_2)$, then, because $\overline A_1 \cup \overline A_2 = (A_1 \cup A_2) \cup (A_1' \cup A_2') $, we have that $x \in \overline A_1 \cup \overline A_2$.
If $x \in (A_1 \cup A_2)'$, then we have that $x$ is a limit point of the set $A_1 \cup A_2$. By the definition of limit point this means that, for every open set $B \in \tau$ such that $x \in B$, $\exists p \in (A_1 \cup A_2): p \in B$ and $p \neq x$. because $p \in A_1 \cup A_2$ we have that $(p \in A_1) \vee (p \in A_2)$ whitch is the same as saying that $x$ is a limit point of $A_1$ $\vee$ $x$ is a limit point of $A_2$. Thus $x \in (A_1' \cup A_2') \to x \in \overline A_1 \cup \overline A_2$.
This means that $\overline{(A_1 \cup A_2)} \subseteq \overline A_1 \cup \overline A_2$.
Part 2
Now let's prove that $\overline{(A_1 \cup A_2)} \supseteq \overline A_1 \cup \overline A_2$
Let $x \in \overline A_1 \cup \overline A_2$. Then $x \in (A_1 \cup A_2) \cup (A_1' \cup A_2')$.
If $x \in (A_1 \cup A_2)$, it's trivial that $x \in (A_1 \cup A_2) \cup (A_1 \cup A_2)' = \overline{(A_1 \cup A_2)}$
If $x \in (A_1' \cup A_2')$, then $x$ is a limit point of $A_1$ or a limit point of $A_2$. This tells us that, for every $B \in \tau$ such that $x \in B$, $\exists p \in A_1 \vee \exists k \in A_2: p \in B \vee k \in B$, such that both $p$ and $k$ are different from $x$. But $p \in A_1 \subseteq A_1 \cup A_2$, and $k \in A_2 \subseteq A_1 \cup A_2$. So we have that $p,k \in A_1 \cup A_2$. So $x$ is also a limit point of $A_1 \cup A_2 \to x \in \overline{(A_1 \cup A_2)}$. This implies that: $\overline{(A_1 \cup A_2)} \supseteq \overline A_1 \cup \overline A_2$
Part 1 + Part 2 (Conclusion)
From part 1 we deduced that $\overline{(A_1 \cup A_2)} \subseteq \overline A_1 \cup \overline A_2$, and from part 2 $\overline{(A_1 \cup A_2)} \supseteq \overline A_1 \cup \overline A_2$. This leads us to the conclution that $\overline{(A_1 \cup A_2)} = \overline A_1 \cup \overline A_2$