Here's the first part of the proof—the part I have a question about.
Simply put, I don't see anything here precluding $x_0$ from being on the boundary of $S_0$. And if that's the case then $N_0 \not\subset S_0$. Here's a picture of what's in my brain:
I'm sure that it's somehow implied $x_0$ can't be on the boundary but I'm not seeing it for some reason. Can someone please expand on the proof? Thank you.
Note: this is from Kreyszig's Introductory Functional Analysis with Applications.


The key part you are missing here is in the line
Since $N$ is a subset of $S$, any subset of $\pmb X$ that is mapped into $\pmb N$ is a subset of $\pmb {S_0}$, since $S_0 = f^{-1}(S)$ is by definition the collection of points that get mapped into $S$. This is what forces the $\delta$-neighborhood to "not be on the boundary," since it must be wholly contained in $S_0$, by the definition of inverse image.