If $X\neq\varnothing$ and $\tau=\{\varnothing, X\}$, then any subset of $X$ is compact.
Disproof by counterxample? Not true. Let $X = \mathbb{R}$ with the usual topology and $A = (-\infty,0)$. Clearly $A$ is not compact.
EDIT: Thank you to those below who provided their criticism and feedback.
Here is my new attempt
Let $A \subset X$ and $\{G_{\alpha}\}_{\alpha \in a}$ be an open cover of A.
Since $\emptyset$, $X$ are the only open sets in $\tau$, $G_{\alpha} = X \cup \emptyset = X$
As a result, there is a finite subcover of $A$, hence $A$ is compact
Therefore, any subset of $X$ is compact.
Hint:
Can there be an open cover of $A\subset X$ that is not finite?