Question regarding connected subspaces Let $X$ be a topological space and let $A,B\subseteq X$ be closed in $X$ such that $A\cap B$ and $A\cup B$ are connected (in subspace topology) show that $A,B$ are connected (in subspace topology).
I would appreciate a hint towards the solution :)
 A: Suppose $A$ were disconnected.  Then $A$ is the disjoint union of $A'$ and $A''$ non-empty closed subsets of $A$.  
If $A' \cap B$ and $A'' \cap B$ are both non-empty then $A\cap B$ is disconnected -- a contradiction.
If $A' \cap B$ is empty then $A'$ and $A'' \cup B$ is a partition of $A \cup B$.  Since all the sets in question are closed, this means $A \cup B$ is disconnected -- a contradiction.
A: The general idea of a proof could go as follows. I'll leave the details to you:
Let $\mathbf{2}$ be the two point space with discrete topology and let $f\colon A\to \mathbf{2}$ be a continuous function. $f|_{A\cap B}\colon A\cap B\to\mathbf{2}$ is a continuous function and $A\cap B$ is connected, thus $f|_{A\cap B}$ is constant. Let $g\colon B\to\mathbf{2}$ be the constant function such that $g|_{A\cap B}=f|_{A\cap B}$, then we have a continuous function $f\cup g\colon A\cup B\to\mathbf{2}$ and by connectedness of $A\cup B$, $f\cup g$ is constant. This shows that $f = (f\cup g)|_A$ must be constant as well.
