Discrete subsets in real analysis 
So this is the first time I have seen the definition for a "discrete" subset. I want to first make sure that my understanding is correct. If $D$ is discrete, then D is essentially just the boundary of say, a circle, but the interior is not in D, it's just the boundary. So D could be $D := \{ |z| = 1 | z \in \mathbb{C}\}$ and this is a discrete subset, correct?
 A: A discrete set defined hereby is essentially a formalisation of the general notion of discreteness we have used so soften. The set $\{1, 2, 3, ..\}$ is discrete in the sense that there are "gaps" between any element in the set and all other elements in the set. 
Defining this using balls: If $D$ is a discrete subset of $\Bbb C$. Then there is an open ball centered at every element $z$ of $D$ such that the only element in the said ball is $z$. This is your definition in English.
As for the first part of your problem: $\Bbb Z$ is discrete in $\Bbb R$ since you can take balls with any radius less than $1$ and the only element in the said ball will be its centre.  Same cannot be said about $\Bbb Q$ in $\Bbb R$. The set $\{\frac 1 n \ | \ n \in \Bbb N\}$ is discrete too. Since suppose $\frac 1 m $ is an arbitrary element in it. $ \frac {1}{m + 1} \lt \frac {1}{m } \lt \frac {1}{m - 1} $. You can pick a ball centred at $\frac 1 m$ with radius $r  = \text{Min} \{ \frac {1}{m } - \frac {1}{m + 1}, \frac {1}{m - 1} - \frac {1}{m } \}$. Every finite set too is discrete. The proof is slightly long. Drop a comment if you need it. 

Update: To prove that every finite set is discrete; Suppose there is a finite set $X$ which is not discrete. Then there is an element $z \in X$ such that every open ball centered at $z$ contains an element in $X$ distinct from $z$. Let $r_1 \gt 0$ be arbitrary. $\exists z_1 (\neq z) \in X$ such that $|z_1 - z| \lt r_1$. Let $r_2 = |z_1 - z| \gt 0$. then $\exists z_2(\neq z) \in X$ such that $|z_2 - z| \lt r_2$. Let $r_3 = |z_2 - z| \gt 0$. Continuing in this fashion we can create an infinite subset $\{z_1, z_2, ..., z_n, ..\}$ of $X$ which is infinite leading to a contradiction.  

My knowledge on continuous functions is pitiful so I have to skip problems (ii) and (iii). 
But let's get to (iv). 
$D$ is discrete and compact. For every element $x \in D$ there is an open ball $B(x)$ centred at $x$ such that $B(x) = \{x\}$. Then $\bigcup_{x \in D} B(x) \supseteq D$ which is an open covering of $D$. So there is a finite collection of balls of the form $B(x)$ for $x \in D$ such that there union contains $D$. It follows $D$ is finite. 
Like I said just picture a discrete probability distribution if you will. The elements in the set have "gaps" between them. This is how you picture it, I think. Your comprehension I'm afraid is completely flawed. Since the definition of a boundary of a set $D$ implies each one of its neighbourhoods (including all open balls) contain elements of $D$ and $D^C$. 
Footnote: The idea of gaps between elements does not always work, I just realised. $\Bbb Q$ is not discrete but there are gaps in it. Maybe by gaps you need to understand that there is a definite "distance" between an element in a discrete set and all other elements in it. 
