Suppose a sequence of continuous functions $f_n(x)$ converges to a function $f(x)$ on $x \in \mathcal{C}$ pointwise, i.e., $$\lim_{n \to \infty} f_{n}(x) = f(x), \ \forall \ x \in \mathcal{C}.$$ Then can we exchange the limit and max operations as follows
$$\lim_{n \to \infty} \max_{x \in \mathcal{C}} f_{n}(x) = \max_{x \in \mathcal{C}} f(x)$$ Or under what conditions of domain $\mathcal{C}$ does above hold? For example, how about $\mathcal{C} = \{x: x\geq 0\}$? How about $\mathcal{C}$ being a compact set?