Let $X,Y$ be compact, connected, simply-connected, and separable, metric spaces each with at-least $2$-points, and let $f,g:X\rightarrow Y$ be continuous functions. Does there always exist a homeomorphism $\Phi:X\times Y \rightarrow X\times Y$ such that
$$
g(x) =\pi\_Y\circ \Phi(x,f(x))
$$
for all $x \in X$, where $\pi\_Y$ is the canonical projection of $X$ onto $Y$?


*Heuristically (but not exactly)*:
"Can we always perturb the graph of a continuous function so that it becomes the graph of another function?"



Projecting Graph of a Function acted on by a homeomorphism
No. Take $I=[0,1]$, $Q=[0,1]\times[0,1]$ and $J=\{0\}\times[1,2]$. Let $X=I$ and $Y=Q\cup J$. Let $f:X\to Y$ be the constant function $f(x)=(0,\frac32)$ and let $g$ be the constant function $g(x)=(\frac12,\frac12)$. Then any homeomorphism $\Phi$ of $X\times Y$ will preserve the square $I\times J$, so $\pi\_Y(\Phi(x,f(x)))\in J$ and therefore cannot be equal to $g(x)$.


**Added a bit later:** The answer is negative even if you additionally assume that the two spaces are homogeneous. Take $X=Y=S^2$. Let $f:X\to Y$ be the identity map of $S^2$ and let $g:X\to Y$ be a constant map taking the value $c\in S^2$. Then the requirement $g(x)=\pi\_Y(\Phi(x,f(x)))$ becomes $\pi\_Y(\Phi(x,x))=c$. In other words, $\Phi(x,x)=(h(x),c)$ where $h:S^2\to S^2$ is a homeomorphism. But $(S^2\times S^2)\setminus\Delta$ (here $\Delta$ is the diagonal) and $(S^2\times S^2)\setminus (S^2\times\{c\})$ are [not homeomorphic](https://mathoverflow.net/questions/92337/total-spaces-of-ts2-and-s2-times-r2-not-homeomorphic), so there is no such $\Phi$.


