$B$ is a basis for a topology if any open set can be written as the union of elements of $B$.
If some set can be written as the union of elements of $B$, is it correct that this set is open?
In other words is $\tau = \cup B$?
$B$ is a basis for a topology if any open set can be written as the union of elements of $B$.
If some set can be written as the union of elements of $B$, is it correct that this set is open?
In other words is $\tau = \cup B$?
On
If $B$ is a basis, then yes, any set written as a union of elements from $B$ will be open, this follows directly from the definition of a topology, as one must have that any union of open sets is open.
It is not the case that $\tau=\cup B$, rather, $\tau=\{\cup_{i\in I} K_i:K_i\in B\}$, that is, the topology is the collection of all sets which are unions of basis elements (hence why I stressed the word 'from' above; it doesn't matter how many or how few of the basis elements you union together, the resulting set is open, and hence in the topology).
On
Some authors say basis .Some say base. The English word "bases" is the plural of both words.
If $T$ is a topology on a set $S$ then $B$ is a base for $T$ iff (1) $ B\subset T $ and (2) Every $t\in T $ is equal to $\cup C$ for some $C\subset B.$
A family $B$ of subsets of a set $S$ is a base for a topology on $S$ iff (1) $ \cup B=S $ and (2) whenever $b_1,b_2 \in B$ and $x\in b_1\cap b_2$ there exists $b_3\in B$ with $x\in b_3\subset b_1\cap b_2.$
Observe that a family $B$ of subsets of $S$ which is closed under finite intersections and satisfies $\cup B=S$ is a base for a topology on $S$ but a base for a topology is not necessarily closed under finite intersections. For example if $B=\{(x,x+r)\cup (x+r,x+2r):x\in \mathbb R\land r>0\}$ then $B$ is a base for $\mathbb R,$ but if $b_1,b_2\in B$ then $b_1\cap b_2$ often fails to belong to $B.$
Observe that if $B$ is a base for the topology $T$ and $U\subset B$ then $U\subset T$ so $\cup U\in T.$
Observe that a topology may have many bases. In particular $T$ is a base for $T.$
Your first statement is not correct: $\mathscr{B}$ is a base for a topology $\tau$ on $X$ if a set $U\subseteq X$ is open if and only if $U$ can be written as a union of elements of $\mathscr{B}$. In other words, both the condition in your first sentence and the condition in your second sentence must be satisfied in order for $\mathscr{B}$ to be a base for $\tau$.
This is not the same as saying that $\tau=\bigcup\mathscr{B}$, however; in fact
$$\bigcup\mathscr{B}=\bigcup\{B:B\in\mathscr{B}\}=X\;.$$
What is true is that
$$\tau=\left\{\bigcup\mathscr{U}:\mathscr{U}\subseteq\mathscr{B}\right\}\;.$$