Homeomorphisms of disjoint unions and unions in a metric space. Suppose $A$ and $B$ are disjoint subsets of a metric space $X$, equip $A$, $B$, and $A\cup B$ with the subspace topology. Suppose $d(x,y)\geq \delta$ for all $x\in A, y\in B$ and some $\delta>0$. I want to show that $A\cup B$ is homeomorphic to $A\sqcup B$. 
First let me construct a function
$$
f: A\cup B\to A\sqcup B
$$
If $a\in A$ then $f(a)=(a,0)$, if $b\in B$ then $f(b)=(b,1)$. The sets $A$ and $B$ are disjoint, so $f$ is well-defined, the inverse of $f$ is
$$
f^{-1}: A\sqcup B\to A\cup B \\
(a,0)\mapsto a\in A \\
(b,1) \mapsto b\in B\\
$$
$f$ is clearly a bijection, to see that it is a homeomorphism, consider the inverse image of an open subset $(X\times \{ 0\})\cup (Y\times \{1\})$, we get 
$$
f^{-1}((X\times \{ 0\})\cup (Y\times \{1\}))=X\cup Y
$$
For $x\in X$ and $y\in Y$ let $B(\epsilon_x, x), B(\epsilon_y, y)$ be open balls, we can choose $\epsilon_x\leq \epsilon_y<\delta$, so that the intersection of the balls is empty and the balls are contained in $X$ and $Y$ respectively, so $X\cup Y$ is an open set as well. 
Now consider the inverse image of an open set $X\cup Y\subset A\cup B$ under $f^{-1}$, we have
$$
(f^{-1})^{-1}(X\cup Y)=(X\times\{0\})\cup(Y\times \{1\}),
$$
which is an open set.
I am not sure if my proof is correct at all, and why does it need the requirement about minimal distance between $X$ and $Y$?
 A: Consider $A = \mathbb{Z}$, and $B =  \mathbb{R} \setminus \mathbb{Z}$, inside $\mathbb{R}$ with the usual topology. These are disjoint, but $\mathbb{R}$ is not isomorphic to $\mathbb{Z} \coprod \mathbb{R}\setminus \mathbb{Z}$, since e.g. no point of $\mathbb{R}$ is open. 
You always have a map $A \coprod B \rightarrow A \cup B$ which is cts, the $\delta > 0$ assumption gives the openness of the map. 
A: Your proof works. One remark: At the point where you talk about the balls $B(\epsilon_x,x)$, you should always make clear if you are referring to the ball relative to $X$ or to $X\cup Y$. One could say:

Since $X$ is open in $A$, there is an $ϵ_x>0$ such that $B^A(ϵ_x,x)=\{a\in A\mid d(x,a)<ϵ_x\}$ is a subset of $X$. Then if $ϵ_x<\delta$, it follows that $B(ϵ_x,x)$ is disjoint from $B$, so $B^{A\cup B}(ϵ_x,x)=B^A(ϵ_x,x)$. Hence $B^{A\cup B}(ϵ_x,x)$ is a subset of $X$, so $X$ is open in $A\cup B$.

Others have already posted some counterexamples where $A$ and $B$ are not a positive distance apart. Note that this isn't necessary. It also works if $\overline A\cap B$ and $A\cap\overline B$ are empty ($A,B$ are separated sets). Actually it is just a matter of connectedness. The $f:A\cup B\to A⊔B$ being a continuous maps, is just a restatement of $A$ and $B$ being each open in $A\cup B$, which says that $A\cup B$ is disconnected into $A$ and $B.$
A: Your continuity justifications are a bit shaky. (Also, you used $X$ to mean two separate things.)
To see that $f^{-1}$ is continuous, take an arbitrary open subset $U$ of $A\cup B$. Then $U=Y\cup Z,$ where $Y=U\cap A$ and $Z=U\cap V$. By definition of subspace topology, we have that $Y$ is open in $A$ and $Z$ is open in $B$. By definition of disjoint union topology, we have that $Y\times\{0\}$ and $Z\times\{1\}$ are open in $A\sqcup B,$ and so $$(f^{-1})^{-1}[U]=(Y\times\{0\})\cup(Z\times\{1\})$$ is open in $A\sqcup B.$ Note that our $\delta$ didn't come into play, here.
Now, to show that $f$ is continuous, we are going to need to use that $\delta$. Take an arbitrary open subset $U$ of $A\sqcup B,$ so that $U=(Y\times\{0\})\cup(Z\times\{1\})$ for some $Y$ relatively open in $A$ and some $Z$ relatively open in $B,$ by definition of disjoint union topology, and so $$f^{-1}(U)=Y\cup Z.$$ Since $Y$ is relatively open in $A,$ then $Y=V\cap A$ for some open subset $V\subseteq X.$ Likewise, $Z=W\cap B$ for some open subset $W\subseteq X.$ Without loss of generality, we may suppose that $W\cap A=V\cap B=\emptyset,$ for if not, then we can put $$V'=V\cap\{x\in X:d(x,a)<\delta\text{ for some }a\in A\}$$ and $$W'=W\cap\{x\in X:d(x,b)<\delta\text{ for some }b\in B\}.$$ Then $V',W'$ can be shown to be open, $Y=V'\cap A$ and $Z=W'\cap B$, and because of the condition with $\delta$ we can see that $W'\cap A=V'\cap B=\emptyset$.
Now, it then follows that $V\cup W$ is open in $X$, so $(V\cup W)\cap(A\cup B)$ is open in $A\cup B,$ but by our assumption, we have that $$(V\cup W)\cap(A\cup B)=Y\cup Z,$$ as desired. This is due to distributivity of unions and intersections over each other, as $$\begin{align}Y\cup Z &= (V\cap A)\cup(W\cap B)\\ &= \bigl((V\cap A)\cup\emptyset\bigr)\cup\bigl(\emptyset\cup(W\cap B)\bigr)\\ &= \bigl((V\cap A)\cup(V\cap B)\bigr)\cup\bigl((W\cap A)\cup(W\cap B)\bigr)\\ &= \bigl(V\cap(A\cup B)\bigr)\cup\bigl(W\cap (A\cup B)\bigr)\\ &= (V\cup W)\cap(A\cup B).\end{align}$$
