If A and B are both pathwise-connected, and the intersection of A and B is nonempty, show that A union B is pathwise-connected My thought process here was to use a theorem in our textbook that says that a subset A of R is pathwise-connected iff A is an interval. Therefore it suffices to show that A union B is an interval. Since A and B are both intervals and their intersection is nonempty, it should follow that A union B is an interval, but I do not know if I need more for this section of the proof to show that AuB is an interval. Any help would be greatly appreciated.

HINT: You don’t need intervals: you just need the definition of path. Let $p\in A\cap B$, and let $x,y\in A\cup B$. There is a path $f$ from $x$ to $p$ in $A\cup B$ (why?), and there is a path $g$ from $p$ to $y$ in $A\cup B$ (again, why?). Now show how to combine $f$ and $g$ to get a path from $x$ to $y$ in $A\cup B$.
