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 a lower semi-continuous. Assume that $\sup \{ f(x)+g(x) : x \in X \}$ is bounded. Is it true that $$\sup \{ f(x)+g(x) : x \in X \}$$ is attiend? I doubt that the answer is positive. If so, under what minimum conditions is it true? For sure, I don't want to assume the continuity. For instance, can we assume some extra assumption on the space $X$?