I am wondering if perhaps the question missed the monotonocity condition on $f$? (That $f$ is monotonoically increasing). I found the same question here but it had an additional $f$ is monotonically increasing condition:
If there exist sequence such that $g(x_n)=f(x_{n+1})$, then we have $g(x_0)=f(x_0)$ for some $x_0$
I am wondering if we can somehow get rid of this condition, or if there is a typo in the question?
We can adapt the argument in the linked question. If there exists $n$ such that $f(x_n)=g(x_n)$, we are done. If there exists $n$ such that $g(x_n) > f(x_n)$ and $g(x_{n+1}) < f(x_{n+1})$, then we are done by the intermediate value theorem. The same is true if there exists $n$ such that $g(x_n) < f(x_n)$ and $g(x_{n+1}) > f(x_{n+1})$.
Hence, we only need to consider the two cases :
$g(x_n) > f(x_n)$ for all $n$ ;
$g(x_n) < f(x_n)$ for all $n$ ;
and by symmetry only deal with the first one. This is where my argument differs. In the first case, by hypothesis,
$$f(x_n) < g(x_n) = f(x_{n+1}) < g(x_{n+1}).$$
Hence, the sequences $(f(x_n))$ and $(g(x_n))$ are both increasing. But $f$ and $g$ are continuous on a compact interval, so they are bounded. So the sequences $(f(x_n))$ and $(g(x_n))$ both converge, to real numbers $\ell_f$ and $\ell_g$. Since $g(x_n) = f(x_{n+1})$, these limits must be the same : $\ell_f = \ell_g =: \ell$.
Finally, we can find a limit point for $(x_n)$, say $x$. Then $f(x)$ is a limit point for $(f(x_n))$, so is equal to $\ell$. By the same argument, $g(x)=\ell$, so:
$$f(x)=g(x)=\ell.$$