Unfortunately, this becomes a very general post: I have some questions concerning the homotopy invariance of homotopy groups. I start from what should be clear:
If $f,g:(X,x_0)\to (Y,y_0)$ are based homotopic, then $\pi_k(f)=\pi_k(g)$, which is immediately clear from the definition of the homotopy groups. In particular, we get $\pi_k(X,x_0)\cong\pi_k(Y,y_0)$ for based homotopy equivalent spaces and $\pi_k(X,x_0)=0$ for based contractible spaces.
There are maps $f,g:(X,x_0)\to (Y,y_0)$ which are freely homotopic, but not based homotopic: Consider e. g. $f,g:(\mathbb{S}^1,\infty)\to (\mathbb{S}^1\vee\mathbb{S}^1,\infty)$, $f$ corresponds to $x$ and $g$ corresponds to the concatenation $y\star x\star y^{-1}$ where $x$ and $y$ denote the two canonical loops generating $\pi_1(\mathbb{S}^1\vee\mathbb{S}^1,\infty)$. This means the map $[(\mathbb{S}^1,\infty),(\mathbb{S}^1\vee\mathbb{S}^1,\infty)] \to [\mathbb{S}^1,\mathbb{S}^1\vee\mathbb{S}^1]$ is not injective. It is clear that $\pi_1(f)\ne\pi_1(g)$ although $f$ and $g$ are freely homotopic. (true?)
Even worse, there are based spaces, which are (freely) contractible, but not based contractible: Let $(H,0)$ be the Hawaian earring and consider the cone $(\mathscr{C}H,[0,0])$ (i. e. we choose as a basepoint not the cone tip). Then as a cone, $\mathscr{C}H$ is contractible, but every contraction moves the basepoint. (true? The “problem” may be that $0\hookrightarrow H$ is not a cofibration?)
If $(X,x_0)$ is a good pair (i. e. the inclusion $x_0\hookrightarrow X$ is a cofibration), then every path $\gamma:I\to Y$ ending in $y_0$ gives rise to a map $\gamma_\#:[(X,x_0),(Y,\gamma(0))]\to [(X,x_0),(Y,y_0)]$ by extending $f\vee \gamma:(X,x_0)\vee (I,0)\to Y$ to a map $H:X\times I\to Y$ and defining $\gamma_\# f(x) := H(x,1)$.
If $Y$ is connected, every map $f:X\to Y$ is (freely) homotopic to a based map: Choose a path $\gamma:I\to Y$ from $f(x_0)$ to $y_0$, then $H$ from above is a homotopy $f$ to the based map $\gamma_\# f$.
The map $(\gamma,f)\mapsto \gamma_\# f$ gives rise to an action of $\pi_1(Y,y_0)$ on $[(X,x_0),(Y,y_0)]$ and it can be easily seen that $[X,Y]=[(X,x_0),(Y,y_0)]/\pi_1(Y,y_0)$.
My actual questions are:
The statement “If $f,g:(X,x_0)\to (Y,y_0)$ are homotopic, then $\pi_k(f)=\pi_k(g)$” seems to be wrong, already for the fundamental group, even for well-pointed spaces. What is the “next best” statement which is true?
Do we at least know something like “If $(X,x_0)$ and $(Y,y_0)$ are (freely) homotopy equivalent, then $\pi_k(X,x_0)\cong \pi_k(Y,y_0)$.”, which should be the “easy” direction of the Whitehead theorem? Maybe we need some well-pointedness condition?
If (2) fails, do we at least know something like “If $X$ is contractible, then $\pi_k(X,x_0)=0$ for each $k\ge 0$ and $x_0\in X$?”
I apologize for the long question which is partially answered in many other posts here, but I wanted to bring together everything I know and everything I want to know about the role of the basepoint.