$M$ is a compact space. Assume $f$ is upper semi-continuous on $M$, $g$ is lower semi-continuous on $M$, and $f(x) \geq g(x)$ for any $x\in M$.
If $f(x_0) = g(x_0) $ for some point $x_0\in M$, Then $f$ is continuous at $x_0$. What about the topology of the set of the continuous points of both $f$ and $g$? Or the topology of the set of $x$ such that $f(x) = g(x)$ (open or closed？)