I was reading Milnor's Morse theory book,in chapter three , there is a picture to illustrate the case that $f^{-1}[a,b]$ is not compact.
For the theorem that sublevel set diffeomorphic to each other if no critical point in between,and $f^{-1}[a,b]$ is compact.
there is a remark below which says :The condition that $f^{-1}[a, b]$ is compact cannot be omitted. For example Figure $3.2$ indicates a situation in which this set is not compact. The manifold $M$ does not contain the point $p$. Clearly $M^{a}$ is not a deformation retract of $M^{b}$.
the question is why $f^{-1}[a,b]$ is not compact in the picture and why they are not diffeomorphic.

The subset $f^{-1}[a,b]$ is not compact because of the hole at $p$. Arguing with sequences should be enough. The spaces $M^a$ and $M^b$ are not diffeomorphic and $M^a$ not a deformation retract of $M^b$, since they have different fundamental groups. Can you point out why?