Let $X$ be a compact metric space. Assume that $f: X \to \mathbb{R}$ is upper-semi continuous and $g:X \to \mathbb{R}$ is lower semi-continuous. Assume that $\sup \{ f(x)+g(x) : x \in X \}$ is finite. Is it true that $$\sup \{ f(x)+g(x) : x \in X \}$$ is attained? I doubt that the answer is positive. If so, under what minimal conditions is it true? For sure, I don't want to assume continuity. For instance, can we assume some extra conditions on the space $X$?