TITLE: Structure of the Mapping Cylinder of a Continuous Function
QUESTION [5 upvotes]: Let $X,Y$ be topological spaces and $f : X \to Y$ a continuous function. In his book Algebraic Topology, Hatcher constructs the mapping cylinder of $f$ to be the quotient space $M_f = ((X \times I) \sqcup Y)/\sim$, where $(x,1) \sim f(x)$ for all $x \in X$. I'm trying to prove the intuitively obvious claim that $\pi|_Y : Y \to \pi(Y)$ is a homeomorphism, where $\pi : (X \times I) \sqcup Y \to M_f$ is the quotient map.
Here are my thoughts: Clearly the map is continuous and a bijection onto its image, so we just need to show that it's open. For any $U \subset Y$ open, we know that $f^{-1}(U) \subset X$ is open since $f$ is continuous. Then $f^{-1}(U) \times I$ is open in $X \times I$ which implies that $V := (f^{-1}(U) \times I) \cup U$ is open in $(X\times I) \sqcup Y$. $V$ is also saturated with respect to the quotient map $\pi$, so $\pi(V)$ is open in $M_f$. It follows that $\pi(V) \cap \pi(Y)$ is open in $\pi(Y)$, but it's easy to see that $\pi(V) \cap \pi(Y)$ is just $\pi(U)$, and the proof is complete.
I'm pretty sure this reasoning is correct (let me know if it isn't), but I'm trying to figure out if the continuity of $f$ is necessary for the claim to hold. My gut tells me that it shouldn't---even if $X \times I$ is joined to $Y$ by some crazy, discontinuous function, the gluing should still leave $Y$ intact. Is there a way to prove this without relying on the continuity of $f$, or is the claim even true in this case?

REPLY [3 votes]: You really do need $f$ to be continuous.
Suppose that $\pi[U]$ is open in $\pi[Y]$; then $\pi[U]=W\cap\pi[Y]$ for some open $W\subseteq M_f$. Since $W$ is open in the quotient $M_f$, $\pi^{-1}[W]$ is open in $(X\times I)\sqcup Y$. Now
$$\begin{align*}
\big(f^{-1}[U]\times\{1\}\big)\sqcup U&=\pi^{-1}\big[\pi[U]\big]\\
&=\pi^{-1}\big(W\cap\pi[Y]\big)\\
&=\pi^{-1}[W]\cap\pi^{-1}\big[\pi[Y]\big]\\
&=\pi^{-1}[W]\cap\big((X\times\{1\})\sqcup Y\big)\,,
\end{align*}$$
so $U=\pi^{-1}[W]\cap Y$, and $f^{-1}[U]\times\{1\}=f^{-1}[W]\cap(X\times\{1\}$. Thus, $f^{-1}[U]\times\{1\}$ is open in $X\times\{1\}$, and hence $f^{-1}[U]$ is open in $X$.