Proof about connectedness Here's the question I'm doing.
Let $A,B$ be subspaces such that $A \cup B$ and $A \cap B$ are connected. Suppose that both $A$ and $B$ are open. Then, $A$ and $B$ are connected.

It is sufficient to prove that $A$ is connected. Suppose that $A$ is disconnected. Then, $A = U \cup V$, where $U$ and $V$ are open in $A$, disjoint and non-empty. Then:
$$A \cup B = (U \cup V) \cup B = (U \cup B) \cup (V \cup B)$$
Observe that since $A$ is open, $U$ and $V$ are both open. So, $U \cup B$ and $V \cup B$ are open. Moreover, $(U \cup B) \cap (V \cup B) = \varnothing$. Since $A \cup B$ is connected, it follows that $U \cup B$ is empty or $V \cup B$ is empty. WLOG, assume that $U \cup B$ is empty. Then, $U$ is empty and $B$ is empty. This is a contradiction. So, it follows that $A$ is connected. $\Box$
I'm feeling rather uneasy about this argument because it feels like I've missed something, especially since I haven't used the connectedness of $A \cap B$ in the argument. If I've done something wrong, then a hint as to how I could fix it would be nice.
Edit:
It is sufficient to prove that $A$ is connected. Suppose that $A$ is disconnected. Then, $A = U \cup V$, where $U$ and $V$ are open in $A$, disjoint and non-empty. Then:
$$A \cup B = (U \cup V) \cup B = (U \cup B) \cup (V \cup B)$$
$$A \cap B = (U \cup V) \cap B = (U \cap B) \cup (V \cap B)$$
Since $A$ is open, both $U$ and $V$ are open. So, $U \cup B$, $V \cup B$, $U \cap B$ and $V \cap B$ are all open. Now:
$$(U \cup B) \cap (V \cup B) = (U \cap V) \cup B = B$$
$$(U \cap B) \cap (V \cap B) = (U \cap V) \cap B = \varnothing$$
Since $A \cap B$ is connected, it follows that $U \cap B = \varnothing$ or $V \cap B = \varnothing$. WLOG, let $U \cap B = \varnothing$. But now, observe that:
$$A \cup B = U \cup (V \cup B)$$
and it is clear that $U \cap (V \cup B) = \varnothing$ since $U$ and $V$ are disjoint. So, $A \cup B$ is disconnected and this is a contradiction. Hence, $A$ is connected. $\Box$
 A: Let us consider an arbitrary space $(X, \mathscr{T})$ together with open subsets $U, V \in \mathscr{T}$ such that $U \cup V$ and $U \cap V$ are both connected and let us show that $U$ and $V$ must themselves be connected. I would suggest the following approach.
It will suffice to handle the case of $U$ for that of $V$ is to be carried out in complete analogy (by simply interchanging $U$ and $V$). Consider two relatively open subsets $W, W' \in \mathscr{T}_{|U}\colon=\{Z \cap U\}_{Z \in \mathscr{T}}$ such that $U=W \cup W'$ and $W \cap W'=\varnothing$. We endeavour to show that either $W=\varnothing$ or $W'=\varnothing$. For simplicity let us write $T=U \cap V$ and $Z=W \cap T=W \cap V$ respectively $Z'=W' \cap T=W' \cap V$. It is clear that $T=T \cap U=Z \cup Z'$, that $Z \cap Z'=\varnothing$ and respectively that $Z, Z' \in \mathscr{T}_{|T}$, whence from the connectedness of $T$ we infer that either $Z=\varnothing$ or $Z'=\varnothing$.
Without any loss of generality, let us assume that $Z'=\varnothing$ which means that $V \cap W'=\varnothing$. Let us now consider the subset $V'\colon=V \cup W$. Since $U$ is open it follows that $\mathscr{T}_{|U} \subseteq \mathscr{T}$, in other words $W$ and $W'$ are absolutely open (being relatively open to an open subset). Hence $V' \in \mathscr{T}$ and since obviously $W', V' \subseteq U \cup V$ it is clear that $W', V' \in \mathscr{T}_{|U \cup V}$. Since $U \cup V=W' \cup V'$ and $W' \cap V'=(W' \cap W) \cup (W' \cap V)=\varnothing$, the connectedness of $U \cup V$ entails either $W'=\varnothing$ or $V'=\varnothing$, the latter occurrence clearly leading in its own to $W=\varnothing$ since by construction $W \subseteq V'$. This completes our proof.
A: 
Fact: $X$ is connected iff every continuous $f: X \to \{0,1\}$ is constant, where $\{0,1\}$ has the discrete topology.

So let $f: A \to \{0,1\}$ be continuous. Then $f$ is constant on $A \cap B \subseteq A$ because $A \cap B$ is connected, say with value $i_0$.
Define $g: A \cup B \to \{0,1\}$ by
$$g(x)=\begin{cases} i_0 & x \in B\\
                      f(x) & x \in A\\
\end{cases}$$
and note this is well-defined, $g\restriction_A$ and $g\restriction_B$ are continuous and as $A,B$ are both open in $A \cup B$, $g$ is continuous (pasting lemma; also applies when both $A,B$ are closed!) and so constant (with value $i_0$ necessarily), and so $f$ is also constant with that value. Hence $A$ is connected. The proof for $B$ is the same, mutatis mutandis.
