Why is the circle a manifold? I've been reading the book A Comprehensive Introduction to Differential Geometry, Volume 1 by Michael Spivak, and I have a question about a proof in Chapter 1 on manifolds.
My question is related to the proof that $S^1=\{x\in\mathbb{R}^2:d(x,0)=1\}$ is a manifold.  He gives two proofs, both of which are on page 7 of the book.  But I am having trouble following his first argument.  It goes as follows:

The function $f:(0,2\pi)\to S^1$ defined by $f(\theta)=(\cos(\theta),\sin(\theta))$ is a homeomorphism; it is continuous, though not one-one, on $[0,2\pi]$ [...] The function $g:(-\pi, \pi)\to S^1$, defined by the same formula, is also a homeomorphism; together with $f$ it follows that $S^1$ is indeed a manifold.

I find this reasoning confusing, especially with the previous content discussed in the chapter.  Using the definition of a manifold, I don't see how the proof shows that $S^1$ is a manifold.  How does this show that for every $x\in S^1$, that there is some neighborhood $U$ of $x$ that is homeomorphic to $\mathbb{R}^n$ for some $n\ge 0$? What does "bringing together $g$ with $f$" do to prove the claim?
Thanks for the help, and I apologize if this is a silly question.
 A: Spivak is describing an atlas consisting of two charts given by the functions $f$ and $g$ but the notation is imprecise. $f$ is not a homeomorphism unless you take its codomain to be $S^1 \setminus \{ (1, 0) \}$ (because it's not surjective); similarly $g$ is not a homeomorphism unless you take its codomain to be $S^1 \setminus \{ (-1, 0) \}$.
Because every point of $S^1$ is contained in one of these open subsets, the functions $f$ and $g$ together show that every point of $S^1$ has an open neighborhood homeomorphic to an open interval, as follows: if $x \in S^1$ is not $(1, 0)$ then we can consider $f^{-1}(x) \in (0, 2\pi)$, which has an open neighborhood given by some open interval; then we can apply $f$ to this open interval, which (since $f$ is a homeomorphism) is an open neighborhood of $x$. If $x$ is $(1, 0)$ then we apply this argument but for $g$.
The general result being implicitly used is the following. If $M$ is a topological space, say that a chart for $M$ is a pair $(U, \varphi)$ consisting of an open subset $U \subseteq M$ and a homeomorphism $\varphi : U \to U'$ to an open subset $U' \subseteq \mathbb{R}^n$.

Theorem (atlases define manifolds): Let $M$ be a Hausdorff, second-countable topological space. Suppose $(U_{\alpha}, \varphi_{\alpha})$ is a collection of charts for $M$ such that $\bigcup_{\alpha} U_{\alpha} = M$ (an atlas). Then $M$ is locally Euclidean, hence a manifold.

This is worth doing as an exercise.
