Consider a space $G$ obtained by glueing two disjoint cobordisms (the fact that they are might be irrelevant, assume they are topological spaces at first) $L$ and $R$ on a common boundary $C$. (Another possible setting is glueing disjoint topological spaces on a point)
Now consider a continuous function $f$ from the square $[0,1] \times [0,1]$ to $G$ such that $f(0,-) \in L$ and $f(1,-) \in R$, that is on the left side of the square the function is mapped inside $L$ and to $R$ on the right side.
Now, on every horizontal slice $y = a$ of the square there should be, by continuity, a $x \in [0,1]$ such that $f(x,a) \in C$
In a sense, these points should divide the square in two parts, for if there was a "gap" somewhere in the set of such points we could jump from $L$ to $R$ and break continuity.
(EDIT: The question was not correctly formalized, see at the bottom to see the question as it was before)
The question now is whether there is a continuous path making this separation? Formally, is there a continuous path $p : [0,1] \to [0,1] \times [0,1]$ such that $p(0) \in [0,1]\times \{0\}$, $p(1) \in [0,1]\times \{1\}$ (from top to bottom), and that for all $x$, $f(p(x)) \in C$
I'm afraid this might be false for the frontier might be a topologically troublesome space like the topologist's sine curve?
If it is not true in general, is it true in the particular case of $L$ and $R$ being smooth enough, and $f$ being a homotopy? What additional hypothesis would be required to make it true that an homotopy can be split into two "sub"-homotopies?
EDIT: Originally, the question was stated as finding a continuous path $p : [0,1] \to [0,1]$ such that for all $y$, $f(p(y),y) \in C$. This is not possible as proven by Andreas Blass in an Answer: https://mathoverflow.net/q/456226