Originally Posted by

**Showcase_22** Sorry I keep getting this wrong! I think i'm getting either flustered or tired.

let $\displaystyle V \in Y$ be open.

Then $\displaystyle f^{-1}(V) \subset A \cup B$.

If $\displaystyle f^{-1}(V) \subset A$ or $\displaystyle f^{-1}(V) \subset B$ then $\displaystyle f^{-1}(V)$ is open since we know that $\displaystyle f$ is continuous on these intervals.

If $\displaystyle f^{-1}(V)$ has points in both $\displaystyle A$ and $\displaystyle B$ then partition $\displaystyle V$ into two sets $\displaystyle I,J$ where $\displaystyle f^{-1}(I) \subset A$ and $\displaystyle f^{-1}(J) \subset B$.

$\displaystyle f^{-1}(I),\ f^{-1}(J)$ are both open since $\displaystyle f$ is continuous on both $\displaystyle A$ and $\displaystyle B$.

Hence $\displaystyle f^{-1}(V)$ is always open. The preimage of an open set is also an open set so $\displaystyle f$ is continuous.