Compact Sets of $(X,d)$ with discrete metric

Let $C$ be a compact set. As every set is open, for each $c \in C$ the set $\{c\}$ is open and $\bigcup_{c\in C}\{c\}$ is an open cover of $C$. Now, it must have a finite subcover, which tells you that $C$ is finite. The converse is not hard to show.

For b. use the characterizations of continuous functions via the inverse image of open sets, that is $f^{-1}(U)$ is open for open $U$. When all sets are open in $X$ this is however no restrictions whatsoever, whence all functions are continuous.


Hint on (a):

Note that any set $Y\subseteq X$ has the covering $\{\{y\}\mid y\in Y\}$ which is an open cover here (all sets are open, as you remark) and has no subcover. What are the consequences for infinite sets?

Hint on (b):

A function $f:X\to\mathbb R$ is not continuous if some open set $U\subseteq\mathbb R$ exists such that $f^{-1}(U)\subseteq X$ is not open. Now remember that all subsets of $X$ are open.