If $g∘f$ is a homemorphism, then $g$ one-one (or $f$ onto) implies that $f$ and $g$ are homeomorphisms. I need a little explanation, please. Seymour Lipschutz - General Topology, Chapter 7, page 110:
Let $X,Y,Z$ be topological spaces and let $f:X\longrightarrow Y$ and $g:Y\longrightarrow Z$ be continuous. Show that if $g\circ f:X\longrightarrow Z$ is a homemorphism, then $g$ one-one (or $f$ onto) implies that $f$ and $g$ are homeomorphisms.
To show that two functions $f$ and $g$ are homeomorphisms we need to show that there exists an one-to-one correspondence, and $f,f^{-1},g,g^{-1}$ are continuous. As $f$ and $g$ are already continuous by hypothesis, and $g$ one-one (or $f$ onto), we only have to show that $g$ onto (or $f$ one-one), $f^{-1}$, and $g^{-1}$ are continuous. Am I right?
 A: 
As $f$ and $g$ are already continuous by hypothesis, and $g$ one-one (or $f$ onto), we only have to show that $g$ onto (or $f$ one-one), $f^{-1}$, and $g^{-1}$ are continuous. Am I right?

Yes, you're right. Alternatively, you can show that $f$ and $g$ are bijective and open (since they are continuous, it will imply they are homeomorphism).
I consider the case where $g$ is one-to-one, the case of $f$ being similar. There are a few steps, I let you check the details:

*

*$g\circ f$ is a homeomorphism, so it is one-to-one. This implies that $f$ is one-to-one

*Similarly, $g\circ f$ is onto, so $g$ is onto.

*$g$ is also one-to-one by assumption, so $g$ is bijective.

*$g\circ f$ and $g$ are bijective, so $f=g^{-1}\circ(g\circ f)$ is also bijective.

*Since $(g\circ f)^{-1}=f^{-1}\circ g^{-1}$, we have $f^{-1}=(g\circ f)^{-1}\circ g$.

Note that points $1-5$ are standard facts from Set Theory. If you don't know them, I recommend you to check them, as they are useful for topology.


*Finally, let's show that $f$ is open. Let $O$ be open in the topology $\mathcal O_X$ of $X$. Then, since $g$ is continuous and $g\circ f$ is open,

$$
f(O) = g^{-1}\left( g\circ f(O) \right)
$$
is also open. Therefore, $f$ is a homeomorphism.


*I follows immediately that $g=(g\circ f)\circ f^{-1}$ is a homeomorphism.

A: Yes, you are right. Since the first case (where $g$ is one-to-one) was already solved in this duplicate, let us solve the second case, though it is very similar.
So, suppose $f$ is onto.

*

*Since $g\circ f$ is one-to-one, so is $f.$ Since $f$ is a bijection, it has an inverse $f^{-1}.$

*From ${\rm id}_Z=(g\circ f)^{-1}\circ g\circ f$ it follows that $f^{-1}=(g\circ f)^{-1}\circ g\circ f\circ f^{-1}=(g\circ f)^{-1}\circ g.$ Since the right hand side is a composition of continuous functions, $f^{-1}$ is also continuous.

*Hence, $f$ is a continuous bijection with a continuous inverse, i.e. a homeomorphism.

*Finally, $g=(g\circ f)\circ f^{-1}$ is a composition of two homeomorphisms, hence also a homeomorphism.

