If X is simply-connected then any two paths are homotopic via a homotopy relative to the points where they agree Let $X$ be a simply-connected space and $f,g:I\to X$ two paths with the same endpoints and $A=\{s\in I:f(s)=g(s)\}$. Since $X$ is simply-connected there is a homotopy $F:I\times I\to X$ relative $\{0,1\}$. The question is: can we pick $F$ relative $A$?
I've tried considering the open set $I-A$ which is a countable union of disjoint segments $(a_n,b_n)$. Then one can get a homotopy $F_n:[a_n,b_n]\times I\to X$ from $f|[a_n,b_n]$ to $g|[a_n,b_n]$. One may try to glue all these homotopies (or some sort of modifications) $F_n$ to get $F:I\times I\to X$ (which is defined to be $f(s)$ in $A\times I$) but I'm not sure if $F$ ends up being continuous.
Note that this is true for $X\subseteq R^n$ any convex set (just take the linear homotopy). I'm particularly interested in the case where $X=S^2$.
 A: Here is a counterexample.  Let $X$ be the cone on the Hawaiian earring $H$.  Let $p\in H$ be the point where all the loops of $H$ intersect and let $C_1, C_2,\dots,\subset H$ be the infinitely many loops in $H$ accumulating at $p$.  Let $f:I\to H$ be a path which starts at $p$, goes around $C_1$ from $t=0$ to $t=1/2$, goes around $C_3$ from $t=1/2$ to $t=2/3$, goes around $C_5$ from $t=2/3$ to $t=3/4$, and so on.  Let $g:I\to H$ be a path which starts at $p$, goes around $C_2$ from $t=0$ to $t=1/2$, goes around $C_4$ from $t=1/2$ to $t=2/3$, goes around $C_6$ from $t=2/3$ to $t=3/4$, and so on.  Then the set at which $f$ and $g$ are equal is $A=\{0,1/2,2/3,3/4,\dots,\}\cup\{1\}$.  But any homotopy from $f$ and $g$ that stays constant on $A$ must go through the cone point of $X$ on every interval $[n/(n+1),(n+1)/(n+2)]$, since the restrictions of $f$ and $g$ to those intervals are not homotopic rel the endpoints on any subset of $X$ which does not contain the cone point.  By compactness, it follows that the homotopy must pass through the cone point at $1$ as well.  But $1\in A$, so the homotopy is supposed to be constant on $1$, so this is a contradiction.
On the other hand, if $X$ is an open subset of a locally convex topological vector space then the answer is yes.  For in that case, using the notation of your second paragraph, we can choose $F_n$ to be the linear homotopy whenever $[a_n,b_n]$ is such that the convex hull of $f([a_n,b_n])\cup g([a_n,b_n])$ is contained in $X$.  The homotopy you get by gluing together these $F_n$ will then be continuous, because every point of $X$ has a neighborhood base consisting of convex sets.
Note furthermore that if $X$ is such that the answer is always yes, then any retract of $X$ is also such that the answer is always yes (construct the homotopy in $X$, and then compose with the retraction).  It now follows from the previous paragraph that the answer is always yes for any Euclidean neighborhood retract (or any space such that any compact subset is contained in a Euclidean neighborhood retract).  In particular, this includes any manifold and any CW-complex.
It seems plausible to me that the answer is yes whenever $X$ is locally simply connected and Hausdorff, but I haven't been able to get the details of a proof to work out.
