Attaching a topological space to another I'm self-studying Mendelson's Introduction to Topology. There is an example in the identification topology section that I cannot understand:

Let $X$ and $Y$ be topological spaces and let $A$ be a non-empty closed subset of $X$. Assume that $X$ and $Y$ are disjoint and that a continuous function $f : A \to Y$ is given. Form the set $(X - A) \cup Y$ and define a function $\varphi: X \cup Y \to (X - A) \cup Y$ by $\varphi(x) = f(x)$ for $x \in A$, $\varphi(x) = x$ for $x \in X - A$, and $\varphi(y) = y$ for $y \in Y$. Give $X \cup Y$ the topology in which a set is open (or closed) if and only if its intersections with $X$ and $Y$ are both open (or closed). $\varphi$ is onto. Let $X \cup_f Y$ be the set $(X - A) \cup Y$ with the identification topology defined by $\varphi$.
Let $I^2$ be the unit square in $\mathbb{R}^2$ and let $A$ be the union of its two vertical edges. Let $Y = [0, 1]$ be the unit interval. Define $f : I^2 \to Y$ by $f(x, y) = y$. Then $I^2 \cup_f Y$ is a cylinder formed by identifying the two vertical edges of $I^2$.

I don't understand how $I^2 \cup_f Y$ can be a cylinder. The set is equal to $(I^2 - A) \cup Y$. Which is a union of a subset of $\mathbb{R}^2$ and $[0, 1]$. How can this be a cylinder?
The book has an exercise that constructs a torus in a similar manner. I'm hoping to be able to solve it once I understand this example.
I looked up some examples online. While I understand the definitions and theorems of identification topologies, I have no clue how geometric objects are constructed.
 A: Yeah so this is one of those things where imho intuition (given excellently by us2012) is way more important than the details. 
For the details, fix the cylinder as $[0,1] \times S^1$, with coordinates $(h, \theta), \theta \in [0, 2\pi)$ (how high on the cylinder you are, and where you are on the circle at that height). 
For ease of notation, describe points in $I^2 \cup_f A$ as just $(x,y) \in I^2$, modulo $(0,y) \sim (1, y)$. 
Then we have (inverse, continuous) maps $I^2 \cup_f A \rightarrow [0,1] \times S^1$ given by $(x,y) \mapsto (x, 2\pi y)$, and $[0,1] \times S^1 \rightarrow I^2 \cup_f A$ given by $(h, \theta) \mapsto (h, \frac{\theta}{2\pi})$. 
I'll leave checking these are inverse and continuous as an exercise.
A: I think it's good that you ask this question, plus one. Your intuition will eventually develop, don't worry.  I had trouble understanding identification topologies too when I saw them first. It just takes some time to get used to, don't worry. The way I think about it now, is as follows: 
You have two spaces $X,Y$ and you know how you want to "glue" them together, namely, you take all the points in $A \subset X$ and stick them on $Y$. The map $f$ tells you where on $Y$ you stick them. In pictures it looks something like this:

In the example, this looks like this:

