If $A$ and $B$ are conneted and $A\cap B\neq \emptyset$, then $A\cup B$ is connected Can you please let me know if my proof is reasonable?
Prove: If $A$ and $B$ are conneted in $\mathbb{R}^n$ and $A\cap B\neq \emptyset$, then $A\cup B$ is connected
Proof: Suppose that $A\cap B$ is not connected. Then there exist sets $U$ and $V$ such that $U\cup V = A\cap B$, $U=C\cap(A\cap B)$, $V=D\cap(A\cap B)$ for some open sets $C$ and $D$, and $U\cap V=\emptyset$.
But $C\cap(A\cap B)\subseteq C\cap A$ and $D\cap(A\cap B)\subseteq D\cap B$, which means that $U$ and $V$ are relatively open in $A$ and $B$, respectively, which is a contradiction.
Now, $A\cup B = A \cup (A\cap B)\cup B$, where all three sets are connected. Thus, $A\cup B$ is connected.
 A: Your proof appears to have a number of serious errors. The first of which is that $A\cap B$ needn't be connected - for instance, consider the sets $$A=\{(x,y)\in \mathbb R^2:x\geq 0\}\setminus\{(0,0)\}$$
$$B=\{(x,y)\in \mathbb R^2:x\leq 0\}\setminus\{(0,0)\}$$
which have intersection $A\cap B=\{0\}\times(\mathbb R\setminus \{0\})$ which a line, missing the origin, which is decidedly not connected, being partitioned into upper half-plane and lower half-plane.
You start in a reasonable way by assuming there are open $U$ and $V$ with $U\cup V =  A\cap B$ and then take open $C$ and $D$ which coincide with $U$ and $V$ on $A\cap B$. You then assert that $C\cap (A\cap B)\subseteq C\cap A$ implies that $U$ is relatively open in $A$, which is incorrect (see the counterexample I gave). Moreover, those sets being open wouldn't be a contradiction unless you could show that $U\cup V=A$ or $U\cup V =B$ (which you couldn't, since it's not necessarily true).
There's also an error on the last line: you write that since $A\cup B$ is a union of three connected sets, it is connected, but this isn't true - for instance, the union of two disjoint connected sets bounded away from each other is not connected. Moreover, the case where they intersect is what you're trying to prove, so this is circular.
I'd suggest that you try rewriting the proof starting with a more direct premise: Suppose that $U\cup V=A\cup B$ is a partition of $A\cup B$ into two disjoint open sets $U$ and $V$. Then, work from there towards a contradiction. Considering the sets $A\cap U$ and $A\cap V$ is a good direction to go in, if you're stuck.
A: Consider $f:A\cup B\rightarrow \{0,1\}$ continuous. Since $A$ is connected, $f(A)=0$ or $f(A)=1$. Suppose $f(A)=0$, then $f(A\cap B)=0$. Since $B$ is connected the restriction of $f$ to $B$ is constant, so $f(B)=f(A\cap B)=0.$. Same argument if $f(A)=1$, so $f$ is constant. Thus $A\cup B$ is connected.
