Let $f : X = [0,2] \cup (3,5] \to Y = [0,3]$ be defined by $$f(x) = \begin{cases} x &\text{ if } x \in [0,2] \\ x - 2 &\text{ if } x \in (3,5]. \end{cases}$$ I want to show that $f$ is a quotient map. It is easy to see that $f$ surjects and that $f$ is continuous, as it is linear on connected components of the domain. However, I am having trouble proving the forward direction of the quotient property, i.e., $f^{-1}(U)$ open in $X$ if and only if $U$ open in $Y$.
I also know a proposition that says if $q : A \to B$ is continuous and $\exists \ r: B \to A$ so that $r$ continuous and $q \circ r = id_B$, then $q$ is a quotient map. However, I am not sure if that quite helps. I came up with a function $r$, but it was not continuous.