Is a discrete set inside a compact space necessarily finite? Is it true that if $A$ is discrete as a subspace of $X$, and $X \;$ is compact, then $A$ is finite?

If this doesn't hold, then does it hold for $X\;$ manifold?
It is not true in general. Let $X = \{0\}\cup\{2^{-n}:n\in\mathbb{N}\}$ with the topology inherited from $\mathbb{R}$; then $X$ is compact, and $X\setminus \{0\}$ is an infinite discrete subset of $X$. Of course every closed discrete subset of a compact space is finite, so infinite discrete subsets won’t be closed, but in general they will exist. For instance, the space $X$ just described can be embedded in any infinite compact metric space.
Singleton sets are open .there union is a cover for X.so this is the cover which do not have a subcover hence X is not compact