Union of two intervals How do you show that, given two open intervals $I$ and $J$ in $\mathbb{R}$,
$$(I\cap J\ne \emptyset)\Leftrightarrow (I\cup J\text{ is an open interval)}$$
 A: Hint: I do not know whether you are supposed to consider also infinite intervals, such as $(5,\infty)$, $(-\infty, 17)$, and $(-\infty,\infty)$. If you are, they are not hard to deal with, it just lengthens the proof. 
Let us start by considering finite intervals $(a,b)$ and $(c,d)$. Because of the symmetry, we can without loss of generality assume that $a\le c$.
Draw a picture. There are two cases to consider: (i) $c\lt b$ and (ii) $c\ge b$. In case (i), show that both sides of the "$\iff$" are true, and therefore the $\iff$ is true. In case (ii), show that both sides of the $\iff$ are false, and therefore the $\iff$ is true.  
Remark: Actually, the "infinite interval" possibilities  can be dealt with simultaneously with the "main" finite intervals case.  But when one is a bit uncertain, attempts at compression can lead to loss of control. 
A: Hint for one direction: If $(a,b)\cap(c,d)\ne \emptyset$ then there is a real number $x$ with $a<x<b$ and $c<x<d$. Let $e=\min\{a,c\}$, $f=\max\{b,d\}$.
Can you show that $(a,b)\cup(c,d)=(e,f)$? I.e. that $a<t<b\lor c<t<d$ implies $e<t<f$? 
For the other direction assume $(a,b)\cup(c,d)=(e,f)$ and show that you cannot have $a<b<c<d$ nor $c<d<a<b$. Conclude that $(c,b)$ and $(a,d)$ are intervals (i.e. $a<d$ and $b<c$) and have nonempty intersection, which is also $(a,b)\cap(c,d)$.
