set is transitive iff union of itself is equal to itself I started studying elementary set theory and came across the following question:

$a$ is transitive if and only if $\bigcup (a \cup \{a\})=a$

and I'm not quite sure what to do. I think I managed to show that if $a$ is transitive, then so is $a\cup \{a\}$:
$x\in a\cup \{a\}$ means that $x\in a$ or $x\in \{a\}$. If $x\in a$, we already know that $a$ is transitive so $x\subseteq a$ and thus $x \subseteq a\cup \{a\}$. If $x\in \{a\}$, this means that $x=a$ and clearly $x=a\subseteq a\cup \{a\}$.
Would appreciate any help with how to proceed with the original question! Thank you!
 A: Let us recall here the definition of a transitive set.

A set $X$ is transitive if
$$\forall x \forall y \; (x \in X \wedge y \in x) \rightarrow y \in X.$$

Now, let’s prove the given equivalente. We must prove two implications as you may know. Let $a$ be a set.
$\implies.$ Suppose that $a$ is a transitive set. Let $x \in \bigcup (a \cup \{a\})$. Then, it exists $b \in a \cup \{a\}$ such that $x \in b$. Since $b \in a \cup \{a\}$, then $b \in a$ or $b \in \{a\}$. If $b \in a$, since $a$ is a transitive set, then $x \in a$. On the other hand, if $b \in \{a\}$, then $b = a$, so $x \in a$. Therefore, $x \in a$ and $\bigcup (a \cup \{a\}) \subseteq a$. Let $y \in a$. Note that it exists a set $z$ such that $y \in z$ and $z \in \{a\}$ (just take $z = a$). Since $z \in \{a\}$, we have that $z \in a \cup \{a\}$. Therefore, it exists a $z$ such that $z \in a \cup \{a\}$ and $y \in z$. So $y \in \bigcup(a \cup \{a\})$ and $a \subseteq \bigcup(a \cup \{a\})$. Hence, $\bigcup (a \cup \{a\}) = a$.
$\Longleftarrow$. Suppose that $\bigcup (a \cup \{a\}) = a$. Let $x, y$ be sets such that $x \in a$ and $y \in x$. Note that $x \in a \cup \{a\}$. So, it exists $z$ such that $y \in z$ and $z \in a \cup \{a\}$. Therefore, $y \in \bigcup (a \cup \{a\})$. By hypothesis follows that $y \in a$. Hence, $a$ is transitive. $\square$
I hope this helps you with your study.
