Solution (source code)

= Solution

\b[False.] In $X=\mathbb R$, take
$$
A=[0,1)\cup\{2\},\qquad B=[1,2].
$$
Then $A\cap B=\{2\}$ and $A\cup B=[0,2]$ are <connected>. Nevertheless $A$ is disconnected: $[0,1)$ and $\{2\}$ are disjoint nonempty relatively <open sets> partitioning $A$. For instance, intersecting $A$ with $(-1,3/2)$ and $(3/2,3)$ produces this separation. The endpoint missing from $[0,1)$ is supplied by $B$, so the union becomes <connected> without forcing $A$ itself to be <connected>.