2 minor correction and clarification

This is not true for $n=2$.

Represent $\mathbb S^2$ as the cylinder $\mathbb S^1\times[-1,1]$ with two discs $D_+$ and $D_-$ attached to the boundary components $\mathbb S^1\times\{1\}$ and $\mathbb S^1\times\{-1\}$, resp. Denote by $\mathbb S^2_+$ and $\mathbb S^2_-$ the "positive" and "negative" hemispheres: $\mathbb S^2_+=(\mathbb S^1\times[0,1])\cup D_+$ and $\mathbb S^2_-$ is the opposite.

First we define $g:\mathbb S^2\to\mathbb R^2$. Consider a smooth $\infty$-shaped loop $\gamma:\mathbb S^1\to\mathbb R^2$. Choose orientations so that the left half of the , namely $\infty$ is followed clockwise and the right half is followed counter-clockwise. I assume that $\gamma$ is contained in a unit square and its two tangent lines at the center are the bisectors of the coordinate angles\gamma(t) = (\sin t,\tfrac12\sin2t) $$(here \mathbb S^1=\mathbb R/2\pi\mathbb Z). Then Note that the velocity of \gamma is separated away from the vertical vector e_2=(0,1), namely \angle(\dot\gamma(t),e_2)\ge\pi/4 for all t\in\mathbb S^1. Choose \varepsilon>0 so small that \angle (\gamma(t+\varepsilon)-\gamma(t),e_2)> \pi/5 for all t. For x=(t,s) from the cylinder, define$$ \begin{cases} g(x) =\gamma(t)+1000s\cdot\overrightarrow{(1,10)} , &\qquad s\ge 0 \cr g(x) =\gamma(t)+1000|s|\cdot\overrightarrow{(-1,10)} , &\qquad s\le 0 . \end{cases} $$(its image of the cylinder consists of two almost vertical strips above the \infty-figure). Observe that the image of each boundary component \mathbb S^1\times\{\pm 1\} is separated away from the image of the other half of the cylinder (by distance at least 100). Extend g to D_+ and D_- so as to fill these boundary components within their unit square neighborhoods of radius 2. Then g(D_+)\cap g(\mathbb S^2_-)=\emptyset and g(D_-)\cap g(\mathbb S^2_+)=\emptyset. Since \gamma(t+\varepsilon)-\gamma(t) never forms a small angle with e_2, the construction guarantees that g(t,s)\ne\gamma(t+\varepsilon) for all t\in\mathbb S^1, s\in[-1,1]. Now we define f:\mathbb S^n\to\mathbb S^n. For x=(t,s) from the cylinder, define f(x)=(t+\varepsilon,0), so the cylinder is projected to its equator and slightly rotated. Extend f to D_+ and D_- so that f(D_+)\subset \mathbb S^2_- and f(D^-)\subset \mathbb S^2_+. For these f and g, we have g(x)\ne g(f(x)) for all x\in\mathbb S^2. Indeed, if x=(t,s)\in\mathbb S^1\times[-1,1], then f(g(x))=\gamma(t+\varepsilon)\ne g(x) as noted above. For x\in D^+ this follows from the fact that g(D^+)\cap g(f(D^+))=\emptyset, and similarly for D^-. 1 This is not true for n=2. Represent \mathbb S^2 as the cylinder \mathbb S^1\times[-1,1] with two discs D_+ and D_- attached to the boundary components \mathbb S^1\times\{1\} and \mathbb S^1\times\{-1\}, resp. Denote by \mathbb S^2_+ and \mathbb S^2_- the "positive" and "negative" hemispheres: \mathbb S^2_+=(\mathbb S^1\times[0,1])\cup D_+ and \mathbb S^2_- is the opposite. First we define g:\mathbb S^2\to\mathbb R^2. Consider a smooth \infty-shaped loop \gamma:\mathbb S^1\to\mathbb R^2. Choose orientations so that the left half of the \infty is followed clockwise and the right half is followed counter-clockwise. I assume that \gamma is contained in a unit square and its two tangent lines at the center are the bisectors of the coordinate angles. Then the velocity of \gamma is separated away from the vertical vector e_2=(0,1), namely \angle(\dot\gamma(t),e_2)\ge\pi/4 for all t\in\mathbb S^1. Choose \varepsilon>0 so small that \angle (\gamma(t+\varepsilon)-\gamma(t),e_2)> \pi/5 for all t. For x=(t,s) from the cylinder, define$$ \begin{cases} g(x) =\gamma(t)+1000s\cdot\overrightarrow{(1,10)} , &\qquad s\ge 0 \cr g(x) =\gamma(t)+1000|s|\cdot\overrightarrow{(-1,10)} , &\qquad s\le 0 . \end{cases}  (its image of the cylinder consists of two almost vertical strips above the $\infty$-figure). Observe that the image of each boundary component $\mathbb S^1\times\{\pm 1\}$ is separated away from the image of the other half of the cylinder (by distance at least 100). Extend $g$ to $D_+$ and $D_-$ so as to fill these boundary components within their unit square neighborhoods.

Since $\gamma(t+\varepsilon)-\gamma(t)$ never forms a small angle with $e_2$, the construction guarantees that $g(t,s)\ne\gamma(t+\varepsilon)$ for all $t\in\mathbb S^1$, $s\in[-1,1]$.

Now we define $f:\mathbb S^n\to\mathbb S^n$. For $x=(t,s)$ from the cylinder, define $f(x)=(t+\varepsilon,0)$, so the cylinder is projected to its equator and slightly rotated. Extend $f$ to $D_+$ and $D_-$ so that $f(D_+)\subset \mathbb S^2_-$ and $f(D^-)\subset \mathbb S^2_+$.

For these $f$ and $g$, we have $g(x)\ne g(f(x))$ for all $x\in\mathbb S^2$. Indeed, if $x=(t,s)\in\mathbb S^1\times[-1,1]$, then $f(g(x))=\gamma(t+\varepsilon)\ne g(x)$ as noted above. For $x\in D^+$ this follows from the fact that $g(D^+)\cap g(f(D^+))=\emptyset$, and similarly for $D^-$.