TITLE: Continuous functions of three variables as superpositions of two variable functions
QUESTION [16 upvotes]: Could we always locally represent a continuous function $F(x,y,z)$ in the form of $g\left(f(x,y),z\right)$ for suitable continuous functions $f$, $g$ of two variables? I am aware of Vladimir Arnold's work on this problem, but it seems that in that context $F(x,y,z)$ is written as a sum of several expressions of this form. Can one reduce it to just a single superposition $g\left(f(x,y),z\right)$; or does anyone know a counter example?  
For related posts see:
Is there any continuous ternary function which can not be represented by composition of continuous binary functions?
Kolmogorov superposition for smooth functions
Kolmogorov-Arnold theorem for (just-)functions

REPLY [30 votes]: Proposition. The function $F(x,y,z)=x(1-z)+yz$ cannot be represented as $F(x,y,z)=g(f(x,y),z)$, where $f,g:\mathbb{R}^2\to\mathbb{R}$ are continuous.

Proof. Suppose to the contrary that we have such a representation. Let $g_1(t)=g(t,0)$. Then 
$$
g_1(f(x,y))=g(f(x,y),0)=F(x,y,0)=x.
$$ 
Let $g_2(t)=g(t,1)$. Then 
$$
g_2(f(x,y))=g(f(x,y),1)=F(x,y,1)=y.
$$
Let $h=(g_1,g_2):\mathbb{R}\to\mathbb{R}^2$, $h(t)=(g_1(t),g_2(t))$. Then
$$
(h\circ f)(x,y)=(g_1(f(x,y)),g_2(f(x,y)))=(x,y).
$$
In particular, it implies that $f:\mathbb{R}^2\to\mathbb{R}$ is one-to-one. 
It remains to show there there are no one-to-one continuous functions from $\mathbb{R}^2$ to $\mathbb{R}$. Suppose to the contrary that such a function $f$ exists. Let $\mathbb{S}^1\subset\mathbb{R}^2$ be the unit circle. Then
$$
f|_{\mathbb{S}^1}:\mathbb{S}^1\to\mathbb{R}
$$
is continuous and one-to-one. Since $\mathbb{S}^1$ is compact, $f|_{\mathbb{S}^1}$ is a homeomorphism of $\mathbb{S}^1$ onto $f(\mathbb{S}^1)$.
Since $\mathbb{S}^1$ is connected and compact $f(\mathbb{S}^1)\subset\mathbb{R}$ is connected and compact. Therefore it is a closed interval, $f(\mathbb{S}^1)=[a,b]$ and we arrive to a contradiction, because $[a,b]$ is not homeomorphic to $\mathbb{S}^1$ (to see this observe that removing an interior point from $[a,b]$ makes the space disconnected while if we remove a point form $\mathbb{S}^1$, the space will remain connected). 
Remark. For a statement and a proof of the Kolmogorov theorem, see for example:
G. G. Lorentz, Approximation of functions, 1966.
Edit. I modified my original answer that was not fully correct. A mistake was pointed out by  Aleksei Kulikov in his comment. The correction is related to the arguments in the comments of KhashF and  user44191.