Questions about sets in Apostol's analysis The first question is this example 
How can these intervals be open sets in $S$  when we can always take the points $0$ and $1$ and won't be able to find an open ball of radius $r>0$ whose points are all contained in these intervals? 
The second question is in this partial proof of the theorem.

I don't see how if $A$ is open in $M$, then $S-A$ is closed in $S$. Here's how I tried to understand this.
Since $A$ is open in $M$, we can always choose a point in $ A\cap S$ and find a ball of radius $r>0$ completely contained in $A$. The intersection of this ball with $S$ is some region in $A\cap S$. If the original point we picked isn't on the boundaries of the region, we can always find a ball of radius $r_2$ small enough such that $r>r_2>0$ and the entire ball is contained in $A\cap S$ and so, $A\cap S$ is open in $S$. Now the set of elements in $S-A$ is the same as those in $S-(A\cap S)$ which shows that $S-A$ is closed in $S$. This argument only works if both $S$ and $A$ have no boundaries since we can't find a ball around a point on the boundary whose elements are all contained in the intersection, we know $A$ doesn't, but no such hypothesis was stated for $S$.
 A: 
How can these intervals be open sets in S when we can always take the points 0 and 1 and won't be able to find an open ball of radius r>0 whose points are all contained in these intervals?

We will be able to.
What's the definition of "open ball"?
An open ball $B(x,r) = \{y \in X| d(y,x) < r\}$.
So if $X = [0,1]$ and then if $0 < r < 1$ then  $B(1,r) = \{y\in [0,1]| d(y,0) <r\} = (1-r, 1]$.
That's an open ball.  And $(x, 1]$ is an open set.
=====

I don't see how if A is open in M, then S−A is closed in S

If $A$ is open in $M$ then $A\cap S$ is open in $S$.
Pf:  If $A$ is open in $M$ then every $x \in A\cap S \subset A$ will be such that there is an open ball with radius $r$ so that $B(x,r)=\{y\in M|d(y,x) < r\}$ so that $B(x,r) \subset A$.
But if $B(x,r) \subset A$ then $B_S(x,r) = \{y \in S|d(y,x) < r\}\subset A\cap S$.  So $A\cap S$ is open in $S$.
ANd you had a theorem that if $O\subset X$ is open in metric space $X$ then $O^c = X\setminus O$ is closed in $X$.
So as $A\cap S$ is on in $S$, then the complement, $S \setminus A$, must be closed in $S$.
A: In a metric space $X$ with metric $d$, a subset $A$ of $X$ is open (relative to the metric) if and only if for every $a\in A$ there exists $\delta\gt 0$ such that
$$B_X(a,\delta) = \{x\in X\mid d(x,a) \lt \delta\} \subseteq A.$$
Note that everything happens inside of $X$. You don’t get to “go outside” of $X$, even if such an outside naturally exists. 
Now suppose you have a subset $S\subseteq X$. The metric of $X$ restricts to $S$, and so $(S,d|_S)$ is also a metric space, and hence we can ask about subsets of $S$ being open or not. When is $A\subseteq S$ open in this space? When for any $a\in A$, there exists $\delta\gt 0$ such that
$$B_S(a,\delta) = \{x\in S\mid d(x,a)\lt \delta\}\subseteq A.$$
That is, the same condition, but now we only look at elements of $S$, not at elements of $X$. Why? because you aren’t looking at “open-in-$X$”, you are looking at open-in-$S$. You only look at elements of $S$, you ignore the elements that are not in $S$. 
So when $X=[0,1]$ with the usual metric, the set $A=[0,x)$, $0\lt x\lt 1$, is open. Why? Because if we take $a\in A$, then $0\leq a\lt x$. Letting $\delta = \frac{1}{2}(x-a)$, we have that
$$B_X(a,\delta) = \{ r\in [0,1)\mid d(a,r)\lt \delta\}$$
is completely contained in $A$.

Second question: $B$ is closed (in $M$), so its complement is open. $A=M-B$ is open, and then $B=M-A$ with $A$ open (in $M$). 
Now, I claim that $S\cap A$ is open in $S$: if $a\in S\cap A$, then because $A$ is open in $M$, there exists $\delta\gt 0$ such that $B_M(x,\delta)\subseteq A$. Now consider $B_S(x,\delta)$. We have
$$\begin{align*}
B_S(x,\delta) &= \{s\in S\mid d(s,x)\lt \delta\}\\
&\subseteq \{s\in M\mid d(s,x)\lt \delta\} &\text{(since }S\subseteq M)\\
&= B_M(x,\delta)\\
&\subseteq A.
\end{align*}$$
On the other hand, $B_S(x,\delta)\subseteq S$. Since $B_S(x,\delta)$ is contained in both $S$ and $A$, then $B_S(x,\delta)\subseteq S\cap A$. 
Thus we have shown that for every $x\in S\cap A$, there exists $\delta$ such that $B_S(x,\delta)\subseteq S\cap A$. Hence $S\cap A$ is open in $S$. 
Note that “boundary” doesn’t enter into it. This is all about balls in the appropriate ambient set.
Okay, now, since $S\cap A$ is open in $S$, then $S-(S\cap A)$ is closed in $S$. And now it is an easy check to verify that
$$S-A = S-(S\cap A).$$
Thus, $S-A$ is closed in $S$, as claimed.
Again, note that boundary doesn’t enter into it.
Your error throughout is thinking that when you work in the relative metric of the subset, you should consider all points in the ambient space. You don’t; you just take points in the subset. Same way when we don’t take spheres in $\mathbb{R}^3$ when we look at open sets in $\mathbb{R}^2$.
