I want to verify that my solution to one of the exercises from Munkres' book Topology is correct.
Exercise (#4, §18, pg. 111)
Let $X, Y$ be two topological spaces. Given $x_0 \in X, y_0 \in Y$, show that the maps $f : X \rightarrow X \times Y$ and $g : Y \rightarrow X \times Y$ defined by
$$ f(x) = (x , y_0) \qquad \text{and} \qquad g(y) = (x_0 , y)$$
are imbeddings.
Solution
It is clear that $f$ and $g$ are injective maps. By restricting the codomains to their images, we get bijective functions $f' : X \rightarrow f(X)$ and $g' : Y \rightarrow g(Y)$ which are continuous by Theorem 18.2.e (restricting the codomain of a continuous function yields a continuous function) that they are continuous. To show that they are imbeddings, it remains to be shown that their inverses are continuous. The inverses are restrictions of the projections:
$$ \pi_1 : X \times Y \rightarrow X \qquad \text{and} \qquad \pi_2 : X \times Y \rightarrow Y,$$
which are continuous: let $V$ be an open set of $X$, $$\pi_1^{-1}(V) = \{ (x , y) \in X \times Y\ |\ x \in V \} = V \times Y.$$ Since $V$ is an open set of $X$, and $Y$ is an open set of itself, $V \times Y$ is an open set of the product topology on $X \times Y$ which is generated by the basis $$\{ U \times V\ |\ U\ \text{is open in}\ X,\ V\ \text{is open in}\ Y \}.$$ Same argument applies for $\pi_2$. The inverses of $f'$ and $g'$ are domain-restrictions of $\pi_1$ and $\pi_2$ to $f(X)$ and $g(Y)$, meaning they must be continuous by Theorem 18.2.d (restricting the domain of a continuous function yields a continuous function).
Best Answer
You solution is correct. It is a special case of a more general result:
Let $f : A \to B$ be a map between topological spaces $A, B$. If it has a left inverse $g : B \to A$ (which is map such that $g \circ f = id_A$), then $f$ is an embedding.
To see this note that
$f$ is injective because if $f(a) = f(a')$, then $a = g(f(a)) = g(f(a')) = a'$.
Therefore $f' : A \stackrel{f}{\rightarrow} f(A)$ is a continuous bijection.
The inverse bijection $(f')^{-1} : f(A) \to A$ is continuous because we have $(f')^{-1} = g' = g \mid_{f(A)} : f(A) \to A$. This follows from $g' \circ f' = id_A$ which implies $g ' = g' \circ id_{f(A)} = g' \circ (f' \circ (f')^{-1}) = (g' \circ f') \circ (f')^{-1} = id_A \circ (f')^{-1} = (f')^{-1}$.