Can two hikers on different trails always reach the peak of a mountain while matching altitude? Formally, suppose we have two continuous functions $f,g:[0,1]\to [0,1]$ with $f(0)=g(0)=0$ and $f(1)=g(1)=1$. Is it always possible to find continuous parameter functions $\phi_1,\phi_2$ both starting at $0$ and ending at $1$ such that $f(\phi_1(t))=g(\phi_2(t))$ for all times $t$? Equivalently, if we let $h:[0,1]^2\to [0,1]$ be defined by $h(x,y)=f(x)-g(y)$, is it always possible to find an implicit curve $\phi:[0,1]\to[0,1]^2$ connecting $(0,0)$ to $(1,1)$ satisfying $h(\phi(t))=0$ for all $t$?
One proof method I attempted was based on this conjecture I had, which ended up being false. If the conjecture were true, taking the connected component of $(1,0)$ for the open set $\{(x,y) : h(x,y)\neq 0\}$ and path connecting its boundary would solve the problem, but such path connections are not guaranteed to exist, as demonstrated in my counter example.
In the simpler case that $f,g$ have finitely many critical points (local extrema), the answer is in the affirmative. In this simpler case, the critical points are isolated, so both paths start out as strictly increasing and both hikers can move forward matching pace to stay at the same altitude. Whenever one hiker reaches a critical point, that hiker continues their direction while the other hiker reverses direction and starts backtracking. So long as they do not reach a critical point simultaneously, this method can be formalized to construct $\phi$ in such a way that it never backtracks on itself (even if the individual hikers do), and since there are only finitely many critical points, eventually $\phi$ must reach the corner $(1,1)$. This can be extended to the case where there are simultaneous critical points by employing a maze solving algorithm where $\phi$ always takes right-hand turns when possible, but the formalization is tedious. This method seems to be impossible in general case however, which could possibly be very pathological and have infinitely many critical points.
 A: There are counter examples when one of the functions is locally constant. Take the case where $f$ is monotone and in a neighborhood of $x=\frac{1}{2}$ we have $f(x)=\frac{1}{2}$ locally constant and $g(x)=(x-\frac{1}{2})\sin\left(\frac{1}{x-1/2}\right)$. If we had such $\phi_1,\phi_2$ as desired, we could find some $t_0$ satisfying $\phi_2(t_0)=\frac{1}{2}$, then as $t\to t_0$ we have $g(\phi_2(t))$ oscillating above and below $\frac{1}{2}$ infinitely often, so likewise so does $f(\phi_1(t))$. Since $f$ is monotone and locally constant around $\frac{1}{2}$ however, this implies $f(\phi_1(t))$ is infinitely often above and below that neighborhood of local constancy, a contradiction of continuity.
This is a known problem, and the corresponding question for when $f,g$ are restricted  to never be locally constant has been shown to be true in the affirmative. In this paper by John Philip Huneke, it is proven in their Lemma 2 that the the functions $\phi_1,\phi_2$ do always exist. Credit to Gerry Myerson for bringing this to my attention in the comments.
