Suppose you have a homotopy $F$ as you describe, and let $x_0\in X$ be the constant you mention (ie $F(x,1)=x_0$ for all $x\in X$).
Take$f:X\to \{x_0\}$ the only possible map and $g: \{x_0\}\to X$ the inclusion map. Then obviously $f\circ g$ is the identity of $\{x_0\}$. Now $g\circ f$ is the constant map $X\to X$, $x\mapsto x_0$, so $F$ is precisely a homotopy between $Id_X$ and $g\circ f$; thus $g\circ f\simeq Id_X$.
Actually you see that the equivalence is just the very definition of what it means that the identity map is homotopic to a constant map, since a constant map is just the composite of a map $X\to \{pt\}$ and a map $\{pt\}\to X$.
Your proof is indeed correct. You rely on the critical notion that if $f \simeq g$ and $h \simeq k$ then $f \circ h \simeq g \circ k$. This observation is critical in another short proof of the fact.
Background:
Consider the "homotopy 1-category", where the objects are topological spaces and the arrows are continuous functions, quotiented by $\simeq$. The fact that this is actually a category is equivalent to the above observation about composition preserving $\simeq$
$\DeclareMathOperator{\id}{id}$
The terminal object of this category is the singleton space 1, because this is the terminal object of the category of topological spaces. In other words, there is only one map from a space $T$ to the singleton space 1, up to homotopy.
It can easily be seen that a space is contractible iff the space is isomorphic to 1 in the homotopy category.
If the space is isomorphic to 1, then consider the homotopy-isomorphism $f : 1 \to A$ and inverse $g : A \to 1$. Then we see that $\id_A \simeq f \circ g$, and $f \circ g$ is a constant function $C_{f(x)}$ where $x$ is the unique element $x \in 1$.
On the other hand, if $\id_A \simeq C_{a_0}$, then define $f : 1 \to A$ by $f(x) = a_0$ and let $g : A \to 1$ be the unique function. Then we see that $C_{a_0} = f \circ g \simeq \id_A$, so $A$ is homotopy-isomorphic to 1.
Thus, a contractible space is exactly a space which is a terminal object in the homotopy category.
End background
In general, if we have a terminal object $1$ and arrows $i : A \to 1$ and $r : 1 \to A$ such that $r \circ i = \id_A$, then $i$ is an isomorphism. This is because we have $i \circ r : 1 \to 1$ and $\id_1 : 1 \to 1$, and hence $i \circ r = \id_1$.
Thus, the retract of a contractible space is contractible.
Best Answer
In fact Rotman is a bit sloppy when he speaks about nullhomotopic paths.
The concept of "nullhomotopic map" is defined on p.16 for maps $f : X \to Y$ between arbitrary spaces $X,Y$. For paths $f : I \to X$, however, one does not consider the relation of being homotopic, but the relation of being homotopic rel $\dot I$. In Exercise 3.4. Rotman uses the phrase nullhomopotic rel $\dot I$ (which of course only applies to closed paths because a non-closed path cannot be homotopic rel $\dot I$ to a constant map).
This is what he means in the section occurring in your question - but admittedly he does not explicitly say it.
You are right, each path $f: I \to X$ is nullhomotopic. The reason is that $I$ is contractible (your assignment $(s,t) \mapsto st$ describe a contraction).
However, in general there are closed paths which are not nullhomopotic rel $\dot I$.
Again a bit sloppy. One can identify $A$ with $A' = \{[a,0] \mid a \in A\} \subset CA$. This is common practice, nobody cares about that the fact that $A$ is not a genuine subspace of $CA$.
If we have $\pi_1(A,x_0) \ne 0$, then clearly $j_* : \pi_1(A,x_0) \to \pi_1(CA,x_0)$ has a non-trivial kernel ($\ker j_* = \pi_1(A,x_0)$).
Indeed inclusion-induced $j_* : \pi_1(A,x_0) \to \pi_1(X_0)$ are in general neither injective nor surjective.