You’ve slightly misstated the definition: $I$ is a component interval of $S$ if there is no open interval $J\subseteq S$ that properly contains $I$. Moreover, in this context $S$ is a bounded open set in $\Bbb R$.
A component interval of $S$ is, first of all, an open interval in $\Bbb R$. It therefore can’t look like $(0,1)\cap\Bbb Q$, for instance, because that isn’t an interval in $\Bbb R$: it’s missing all of the irrationals between $0$ and $1$.
Consider the set $S=\{x\in\Bbb R:-1; a little thought will show that $S=(-1,2)\cup(4,5)$. Here the intervals $(-1,2)$ and $(4,5)$ are the component intervals of $S$: each is an open interval, their union is all of $S$, and if you expand either of them even slightly to get a larger open interval, you pick up points that are not in $S$. $(-1,2)$ and $(4,5)$ are as big as they can be and still be open intervals contained in $S$. This set $S$ therefore has exactly two component intervals.
Now consider the set $S=(0,1)\setminus\left\{\frac1n:n\in\Bbb Z^+\right\}\;.$ $S$ is a bounded open subset of $\Bbb R$, and if you draw a sketch, you should be able to convince yourself pretty easily that
$\begin{align*} S&=\left(\frac12,1\right)\cup\left(\frac13,\frac12\right)\cup\left(\frac14,\frac13\right)\cup\left(\frac15,\frac14\right)\cup\dots\\ &=\bigcup_{n\in\Bbb Z^+}\left(\frac1{n+1},\frac1n\right)\;. \end{align*}$
Each of the intervals $\left(\frac1{n+1},\frac1n\right)$ is an open interval contained in $S$ that cannot be expanded to a larger open interval contained in $S$: if you try to expand $\left(\frac14,\frac13\right)$, for instance, you’ll get an interval that contains either $\frac14$ or $\frac13$ (or both) and therefore won’t be a subset of $S$ at all. By definition, therefore, each of these intervals $\left(\frac1{n+1},\frac1n\right)$ is a component interval of this set $S$. And since their union is all of $S$, they are all of the component intervals of $S$. This set $S$ has countably infinitely many component intervals, one for each $n\in\Bbb Z^+$.
What Apostol is going to prove there is that every bounded open subset of $\Bbb R$ can be decomposed in this way into component intervals, and that there are always at most countably infinitely many of these component intervals.