This is example 3.6.2 of How to Prove It by Velleman, and the proof he gives is the following:
proof
Existence: Clearly $∀ B ( \varnothing ∪ B = B )$, so ∅ has the required property. Uniqueness: Suppose $∀ B ( C ∪ B = B )$ and $∀ B ( D ∪ B = B )$. Applying the first of these assumptions to $D$ we see that $C ∪ D = D$ , and applying the second to $C$ we get $D ∪ C = C$. But clearly $C ∪ D = D ∪ C$ , so $C = D $.
Is something wrong with this proof? I understand the reasoning and why it should be valid, but isn't it also true that $\forall B \ (B\cup B = B)$? If the proof is valid, then that means that $B = \varnothing$, but that's clearly not right.
The other possibility I can see is that writing $B\cup B$ is somehow invalid, but going by the definition of set union I don't see why this would be a problem.
Proved is that a unique $A$ exists such that for every set $B$ we have $A\cup B=B$ and secondly that $A=\varnothing$.
In mathematical notation:$$\exists!A\forall B(A\cup B)=B\text{ and }\forall B(\varnothing\cup B)=B\tag1$$
Yes, it is true that $B\cup B=B$ for every $B$ but that does not lead to the conclusion that $B=\varnothing$.
It would lead to that conclusion if it was proved that for every set $B$ a unique set $A$ exists such that $A\cup B= B$ and secondly that $A=\varnothing$.
In mathematical notation:$$\forall B\exists!A(A\cup B)=B\text{ and }\forall B(\varnothing\cup B)=B\tag2$$
But that has not been proved, and also cannot be proved.
This simply because the first part of statement $(2)$ is false.