The set $A$ is open. Any point in $A$ can be surrounded by a disc that is contained wholly in $A$.
Any point in the interior of $B$ can be surrounded by a disc that is contained wholly in $B$. However, this does not work for points on the edge of $B$, so $B$ is not open.
Here we have a point on the edge of $B$. No disk centred there is wholly contained in $B$.