The theorem says: A compact space $(X,\tau)$ is maximal compact (i.e. no strictly larger topology on $X$ is compact) if and only if every compact subset of $X$ is closed in $\tau$.
For "if", I prove by contraposition. Let $U\subset X$ be a compact subset of $X$ and $U$ is not closed in $\tau$. Define a finer topology $\tau':=\tau\cup\{X\setminus U\}$, and we show that $(X, \tau')$ is compact.
Let $S$ be a subbasis of $(X,\tau')$ and let $S'\subseteq S$ be an open cover of $X$. By Alexander subbase theorem: https://en.wikipedia.org/wiki/Subbase#Alexander_subbase_theorem, it's enough to show that $S'$ has a finite subcover.
Since $X\setminus U\in\tau'$, it is the finite intersection of elements in $S$. But this is not good enough because ideally I want to express $X\setminus U$ (and $U$) as a finite intersection of sets in $S'$, in order obtain a finite subcover of $S'$. How can I get around this?
Let $X\setminus U=\cap_{k\leq n}S_k$ be a finite intersection of sets in $S$. Since $S'$ covers $X$, for each $k\leq n$, we have $S_k\subseteq\cup_{i\in I_k}S_i$, $S_k$ is a subset of some (possibly infinite) union of sets in $S'$. Hence $X\setminus U\subseteq\cup_{k\leq n}\cup_{i\in I_k}S_i$. This proof would work if I can somehow reduce $S_k$ to some finite union of sets in $S'$, but I'm not sure if that is at all possible.
I feel like I need to use the compactness of the original space $(X,\tau)$.