But doesn't the topology on X, which must contain $\emptyset$ and $X$, define the open sets? So why is this now saying that $\emptyset$ and $X$ are closed?
A set is not a door. It can be both closed and open at the same time. These two properties are not contradictory in any way. In fact, for any topology, by definition, the entire space and the empty set must be both open and closed simultaneously.
I think you've skipped over the definition of closed set: a subset $V \subseteq X$ being closed doesn't mean it's not open, it means that its complement $X \setminus V$ is open.
It's possible for a set to be both open and closed; such sets are called colloquially called clopen sets. For example: