Why is this manifold a compact and connected one? Is this a "generalization" of $n$-torus? I'm a new learner on the course Smooth Manifold, and now comming up with the following exercise:

Let $g>1$, and consider the polynomial in $x$ with degree $2g$, defined as $$P_g(x) = x(x-1)^2 \cdots (x-g+1)^2 (x-g).  $$ Prove that: $$ M_{g,r} := \{ (x,y,z) \in \mathbb{R}^3 \vert (y^2+P_g(x))^2 + z^2 = r^2 \}$$ is a compact, connected, embedded submanifold of $\mathbb{R}^3$ for sufficiently small $r>0$.

I've proved that this is a embedded submanifold in $\mathbb{R}^3$ with dimension 2, by using the regular level set theorem.
[Attempts: considering the map $F: (x,y,z) \mapsto (y^2+P_g(x))^2 + z^2$ and $M_{g,r} = F^{-1}(r^2)$. Then $r^2$ are regular values of $F$ when $r>0$ is sufficiently small.]
My question is: How to show that $M_{g,r}$ is a compact and connected submanifold?
My attempts: Since $M_{g,r}$ is a embedded submanifold, its topology is the one induced from the standard topology of $\mathbb{R}^3$. So actually it is a purely topological question. For compactness, it suffices to show that $M_{g,r}$ is closed and bounded. Since $M_{g,r} = F^{-1}(r^2)$, and $F$ is continuous, it is closed. But I'm not able to show that it is bounded. I've tried to find a upper bound for $x^2+y^2+z^2$ when $(x,y,z) \in M_{g,r}$ but failed. For connectedness, I know almost nothing on how to judge connectedness except the definition of it.
My naive idea: Can we construct a continuous map $f$ such that $M_{g,r}$ is the image of $f$ of a compact, connected set?
Last naive question: When $g=1$, we see that $M_{1,r}$ is diffeomorphic to the torus $\mathbb{T}^2$. And it seems that $g$ is an abbreviation of “genus” (just a wild guess), so can $M_{g,r}$ be regared as a torus from some perspective of view? (It seems that it is not a $g$-torus, since $M_{g,r}$ is of dimension 2.)
 A: Here's a proof that it's connected by finding a path in $M_{g,r}$ from any point $p\in M_{g,r}$ to the point $(0,0,r)$.
Proposition 1.  Suppose $p=(x_1, y_1, z_1)\in M:=M_{g,r}$.  Then there is a path in $M$ beginning at $p$ and ending at a point of the form $(0, y_2,z_1)$.
Proof:  Because of the symmetry $y\mapsto -y$ of $M$, we may assume without loss of generality that $y_1 \geq 0$.  Set $y(t) =  \sqrt{\sqrt{r^2 - z_1^2}- P_g(tx)}$.  Note that $y(1) = y_1$ and that $(tx, y(t), z_1)\in M$ for any $t$ for which it is defined.  Since we obtain a point of the desired form when $t=0$, it's enough to show that the domain of $y(t)$ contains $[0,1]$.  We will break this verification up into three cases:  $x\in [0,g]$, $x > g$, $x< 0$.
Writing $P_g(x) = x(x-g) q(x)^2$ (where $q(x) = (x-1)...(x-g+1)$), we see that $P_g(x)\leq 0$ for $x\in[0,g]$.  Noting that if $x\in[0,g]$, then $tx\in[0,g]$ when $t\in[0,1]$, we see that $y(t)$ is well defined for $x\in[0,g]$.
Also note that $P_g'(x)$ is a sum of terms involving products $x$,..., $(x-g)$ and all the products are obviously positive if $x > g$.  This shows $P_g$ is increasing for $x > g$.  Noting that $P_g(x) > 0$ if $x > g$, it now follows that $P_g(tx) < P_g(x)$ for any $x > g$ and $t\in[0,1]$.  In particular, $y(t)$ is defined on $[0,1]$ if $x > g$.
Lastly, we need to deal with the case where $x < 0$.  However, $P_g(x)$ is symmetric about the line $y = g/2$.  Thus, by the preceding paragraph, $P_g$ is decreasing when $x<0$ and thus, $P_g(tx) < P_g(x)$ for $x<0$ and $t\in[0,1]$ (since $x < tx$ when $x<0$).  Thus, $y(t)$ is defined when $x< 0$.  $\square$
Propostion 2:  Suppose $(0,y_1,z_1)$ is a point in $M$.  Then there is a path in $M$ to the point $(0,0,r)\in M$.
Proof:  Because $y_1^4 + z^2  = r^2$, it follows that $-\sqrt{r}\leq y_1 \leq \sqrt{r}$, so we may write $y_1 = \sqrt{r}\cos(t)$ for some $t_0\in [0,2\pi]$.  Then the path $(0, \sqrt{r} \cos(t), r\sin(t))$ is a path in $M$ which passes through $(0,y_1,z_1)$ at time  $t_0$ or $2\pi-t_0$.  Further, at time $\pi/2$, it passes through $(0,0,r)$.
A: For connectedness, show that the $(k,y,z) \in M_{g,r}$ is, if $0 \leq k \leq g$, are path-connected (when $y,z$ change, $k$ being fixed – the corresponding fiber is homeomorphic to a circle).
Then, if $0 \leq k \leq x \leq k+1 \leq g$ and $(x,y,z) \in M_{g,r}$, show that $(x,y,z)$ is connected to some $(k,y’,z’)$ or $(k+1,y’,z’)$– the idea is to let $x$ vary so that $P_g(x)$ increases, and change $y$ so that $y^2+P_g(x)$ is invariant (while $y^2+P_g(x) \geq 0$) or $z$ (and not $y$) while $P_g(x)+y^2 < 0$.
When $x$ varies so that $P_g(x)$ is positive decreasing, it’s easy to adjust $y$ continuously do that $y^2+P_g(x)$ is a constant, so every point $(x,y,z)$, $x \notin (0,g)$, is connected to some $F_k$, $0 \leq k \leq g$.
Here we defined $F_k=M_{g,r} \cap \{x=k\}$ – they’re each path-connected and every point of $M_{g,r}$ is path connected to one of them, depending only on its $x$-value (see the construction).
But if $s$ is the minimum on $(k,k+1)$ of $P_g$, then $(s,\sqrt{-P_g(s)},r)$ is connected to both $F_k$ and $F_{k+1}$ (see the construction again and check how $P_g$ varied) so there is a path from each $F_k$ to $F_{k+1}$, so that they’re all connected together and $M_{g,r}$ is connected.
