On page 39 of Allen Hatcher's Algebraic topology (page 19 in the pdf document available on Allen Hatcher's website), exercise 16 c), I have the following proof :
Let $\varphi : S^1 \to S^1 \times D^2$ be a parametrization of the displayed curve. Since this curve is homotopic to a point in $S^1 \times D^2$, $[\varphi] = 0$. If a retraction $r : S^1 \times D^2 \to A$ would exist, then the induced map $r_* : \pi_1(S^1 \times D^2) \to \pi_1(A)$ would be such that $r_*([\varphi]) = r_*([0]) = 0 \in \pi_1(A)$. However, since $r$ is a retraction, it must restrict to the identity on $A$, therefore $r_*([\varphi]) = [\varphi] \neq 0 \in \pi_1(A)$, because $A$ is homeomorphic to a circle and $\varphi$ "goes around it once", thus cannot be a trivial loop.
So that does it for this exercise. It took me a while to figure it out, so I wondered to what extent this argument can be used, and I got stuck somewhere. So the loop that defines $A$, if you untie the knot on the bottom of the picture, it becomes homotopic to a point with no need to self intersect. What if before we tied that knot, we made it go around the torus's "hole" a few times? In other words, what if the curve we began with, after being untied, was going around the torus $n$ times, $n \in \mathbb Z$? (Assume it has only one knot similar to the one shown in the picture.) Call $A_n$ the resulting subspace and $\varphi_n$ the corresponding parametrization.
(I am conscious this is a bit handwavy but it would've taken tremendous amounts of work to make a reasonable online picture...)
In this case, if a retraction onto $A_n$ would exist, then since $\pi_1(S^1 \times D^2) = \pi_1(S^1) \times \pi_1(D^2) \sim \mathbb Z$ (and a loop corresponds to $m \in \mathbb Z$ depending on how many times it goes around the torus, call such a loop $\omega_m$), we have $$ [\varphi_n] = r_*([\varphi_n]) = r_*([\omega_n]) $$ and note that $[\varphi_n] \in \pi_1(A) \simeq \mathbb Z$ corresponds to $1 \in \mathbb Z$, and $[\omega_n] \in \pi_1(S^1 \times D^2) \simeq \mathbb Z$ correponds to $n$. Unless $n = \pm 1$, there is no group homomorphism from $\mathbb Z \to \mathbb Z$ which maps $n$ to $1$, so we cannot have a retraction if $n \neq \pm 1$.
But the $n = \pm 1$ case is still weird, I mean, there's a knot in the curve! I don't think there would be a retraction to the curve in this case either, and this is where I am stuck. (Note that this question is not in the book, so I have no idea where it is going.)
I have not even read section 1.2., so I feel I am lacking some tools to understand this question... any ideas? Is there a retraction from $S^1 \times D^2$ to $\varphi_n(S^1)$ when $n = \pm 1$?
I am not looking for hints, I'm more curious for a solution since I don't expect to know how to solve it with what I have.