Prove that certain quotient space is homeomorphic to an interval. I ran into some trouble trying to prove this. Transgression lemma only got me so far and I'm kind of clueless. Hints?
Let $I$ be an interval and $(X,d)$ a metric space. For a map $\gamma : I\rightarrow X$ define the following equivalence relation on $I$: $y\simeq y\,'$ if and only if $\gamma |_{[y,\,y\,']}$ is constant. Prove that the quotient space $I/\simeq\,$ is homeomorphic to an interval. 
 A: Here’s an argument mostly from first principles. There are undoubtedly easier ways to arrive at the result, depending on how big a hammer you want to use, but working through this argument should give you a pretty good understanding of what’s really going on.
Clearly the $\simeq$-classes are order-convex, meaning that if $a\le b\le c$, and $a\simeq c$, then $a\simeq b\simeq c$. Let $C$ be one of these $\simeq$-classes, let $a=\inf C$, and let $b=\sup C$; the continuity of $\gamma$ implies that $a,b\in C$, so $C=[a,b]$. Thus, every $\simeq$-class is a closed interval. This implies that $I/\simeq\,$ inherits a linear order from $I$: if $C_1$ and $C_2$ are distinct members of $I/\simeq\,$, then $C_1<C_2$ iff there are $c_1\in C_1$ and $c_2\in C_2$ such that $c_1<c_2$. (No confusion should arise from using $<$ and $\le$ for this induced order.)
For convenience let $J=I/\simeq\,$, and for $x\in I$ let $\bar x\in J$ be the $\simeq$-class of $x$; $\bar 0$ and $\bar 1$ are clearly endpoints of the order $\langle J,\le\rangle$. (Here I am assuming without loss of generality that $I=[0,1]$.) If $\bar 0=\bar 1$, then $J$ is a single point, which is of course homeomorphic to a (degenerate) interval, so assume henceforth that $\bar 0<\bar 1$. If two members of $J$ were adjacent in the order $\le$, as intervals in $I$ they would share an endpoint and therefore be part of a single $\simeq$-class, i.e., a single member of $J$, which is a contradiction, so $J$ must be densely ordered by $\le$.
To see that the order topology induced on $J$ by this linear order is the same as the quotient topology, note first that $U\subseteq J$ is open in the quotient topology iff $\bigcup\limits_{u\in U}u$ is open in $I$ iff $\bigcup\limits_{u\in U}u$ is a union of pairwise disjoint open intervals in $I$. Suppose that $\bigcup\limits_{u\in U}u$ is a single open interval, say $(a,b)$, in $I$; then it’s easy to see that $U=(\bar a,\bar b)$ in $J$. Conversely, if $U=(\bar a,\bar b)$, then $\bigcup\limits_{u\in U}u=$  $(\max\bar a,\min\bar b)$. I’ll leave the cases $[0,b)$ and $(a,1]$ to you, as well as the extension of the argument from a single open interval to a union of pairwise disjoint open intervals.
Now let $Q=\{\bar q:q\in\mathbb{Q}\}$; I claim that $Q$ is dense in $J$. To see this, let $\bar x,\bar y\in J$ with $\bar x<\bar y$. There are $a,b,c,d\in I$ such that $\bar x=[a,b],\bar y=[c,d]$, and $b<c$. Clearly $b<c$, so there is a rational $q\in(b,c)$, and evidently $\bar x<\bar q<\bar y$. Thus, $J$ is a separable, densely ordered space with endpoints.
It’s well-known that up to isomorphism there is only one countable dense linear order with endpoints, $\mathbb{Q}\cap I$. (If you’ve not seen this before, it’s proved by this standard back-and-forth argument.) Let $f:Q\to\mathbb{Q}\cap I$ be an order-isomorphism, and extend $f$ to a function $h:J\to I$ as follows. Of course $h\upharpoonright Q=f$. If $\bar x\in J\setminus Q$, let $\langle\bar q_n:n\in\mathbb{N}\rangle$ be a monotonically increasing sequence in $Q$ converging to $\bar x$. Then $\langle f(\bar q_n):n\in\mathbb{N}\rangle$ is a monotonically increasing sequence in $\mathbb{Q}\cap I$, so it converges to some $y\in I$, and we set $h(\bar x)=y$. Of course one has to check that $f(\bar x)$ does not depend on the choice of sequence $\langle\bar q_n:n\in\mathbb{N}\rangle$; this is fairly straightforward $-$ just assume that two different sequences yield different results and get a contradiction $-$ and I leave it to you.
And if you’ve reached this point, you should have little trouble verifying that $h$ is a homeomorphism.
A: I'd like to propose a slightly different approach. We will assume that $I$ is nontrivial (obvious task) and finite (without loss of generality).
We will construct a continuous (nondecreasing) function $f$ from $I$ to some interval $J$ and $f$ will be constant exactly on the equivalence classes of $\simeq$. It will turn out that $\tilde{f}:\ I/\simeq \ \to \ J$ is a homeomorphism.
Let's define $i(x) = [a,b]$, where $[a,b]$ is the maximal interval such that
$x\in [a,b]$ and $\gamma|_{[a,b]}$ is constant. The definition is correct, because $X$ is a metric space (that's the only place where we use any assumptions about $X$ - actually we use only the fact that $X$ is a $T_1$ space).
Edit: Nitpick: if $I\neq[k,l]$, then the first and/or the last (ordered by their beginnings) interval $i(x)$ may be of the form $(a,b]$ and/or $[a,b)$ respectively (or even $(a,b)$ if $\gamma$ is constant). From now on, I will just write $[^*a,b]^*$. End of edit.
Let $In$ be the set of all nontrivial intervals $i(x)$: $$In = \{i(x)\ |\ x\in I \} \setminus \{[a,a]\ |\ a\in I\}.$$
$In$ is of course a countable set and we can enumerate its elements with natural numbers $In = \{in_1, in_2, \ldots \}$.
Our function will be constructed almost like the Cantor function. Let's start with a linear homeomorphism $f_0: I \to [^*0,1]^*$ (the increasing one, $[^*0,1]^*$ interval is open/closed just like $I$). Now, take the first interval $in$ from $In$ and define $f_1$ in the same way as in the case of the Cantor function. From now on, interval $in$ is 'used' which will be informally denoted by $in\in Used$.

Here the technical part starts. I recommend skipping it and the 'excercise ($\heartsuit$)' requiring those technical details during the first reading. $I \setminus \bigcup Used$ is a sum of distinct open (in $I$) intervals. For each such interval $[^* a,b]^*$ we look for an interval $in \in In \setminus Used$ such that $in \cap (a+\frac{b-a}{4}, b - \frac{b-a}{4}) \neq \emptyset$. If such $in$ exists, then we use it to define the next $f_n$ and add to $Used$. Otherwise we take the maximal open interval $(a',b')\subseteq(a,b)\setminus \bigcup In$ and add $[a',b']$ to the $Used$ set.
After finishing the job for all intervals $[^*a,b]^*$ we use the next unused $in \in In$ (to ensure that all the intervals from $In$ will be used) like in the standard construction and repeat the previous step. More precisely - we take the maximal $[^*c,d]^* \subseteq I \setminus \bigcup Used$ containing $in$ and change the values of $f_n$ on $[^*c,d]^*$ in the standard way getting $f_{n+1}$.
Edit: It may be hard to prove that the above construction can always be continued - if $in$ happens to be the whole $[^* a,b]^*$, then we can't continue. So we want $in$ to be inside one of the intervals of $I\setminus Used$. To guarantee that, at the very beginning we use the first and the last interval (ordered by their beginnigs) if they exist (that's the moment responsible for ending up with a degenerated $J$). Later, when adding $[a',b']$ to the $Used$ set, we check if there is unused $in^1$ with its end in $a'$ or $in^2$ with its beginning in $b'$ and add to $Used$ the whole $in^1 \cup [a',b'] \cup in^2$ instead of just $[a',b']$ (and change $f_n$ appropriately). 
  End of edit.
It is not hard to notice that $f_n$ is nondecreasing and $(f_n)$ is a Cauchy sequence in the supremum norm. Consequently it converges to a nondecreasing map $f: I \to [^*0,1]^*$.

$f$ is constant on all the equivalence classes of $\simeq$, so it can be interpreted as a surjective function $\tilde{f}:\ I/\simeq \ \to \ J$ for some interval $J \subseteq [0,1]$. We are almost there, but we don't know yet if $\tilde{f}$ is a homeomorphism.
What we need to finish the proof is that $f$ a) takes different values for arguments belonging to different equivalence classes and b) is open. From a) we know that $\tilde{f}$ is injective so there is $\tilde{f}^{-1}$. From b) we know that $\tilde{f}$ is open so $\tilde{f}^{-1}$ is continuous, so $\tilde{f}$ is homeo.
Both a) and b) follow from the fact that $f(x)\lt f(y)$, whenever $x \lt y$ and not $x \simeq y$ - I left it as an easy excercise ($\heartsuit$).
a) follows easily from the above, for b) we need to notice what the quotient topology $\tau_{I / \simeq}$ is.
$$\tau_{I / \simeq} \ = \ \{ U/\simeq \ | \ U\in\tau_I \} \ = \ \{ U/\simeq \ | \ U\in\tau_I, \bigcup_{x\in U} i(x) \subseteq U \}$$
It is generated by
$$B=\{ [^*a,b]^*/\simeq \ | \ [^*a,b]^*\in\tau_I, \bigcup_{x\in [^*a,b]^*} i(x) \subseteq [^*a,b]^* \}$$
It can be easily checked that $f(b)$ is an open (in $J$) interval for $b\in B$, which guarantees that $f$ is open and finishes the whole proof.
