Immersion is a diffeomorphism. Clearly I suppose to put the condition $n > 1$ in use. So my proof must went wrong.. Could someone help me take a look at it? Thanks!

Suppose $X$ is a smooth, compact, connected $n$-manifold without boundary which admits an immersion to $S^n$. Show that if $n > 1$, then this immersion is a diffeomorphism.

By local immersion theorem,

Local Immersion Theorem
  Suppose that $f: X \to Y$ is an immersion at $x$, and $y = f(x)$. Then there exist local coordinates around $x$ and $y$ such that
  $$f(x_1, \dots, x_k) = (x_1, \dots, x_k, 0, \dots, 0).$$
  In other words,$x$ is locally equivalent to the canonical immersion near $x$.

Therefore, the image of $f$ is open, since $(x_1, \dots, x_k)$ is open in $X$ so $(x_1, \dots, x_k, 0, \dots, 0)$ is open in $Y$. Also, because $X$ is compact, $f$ is proper. Therefore, $f$ is an embedding. According to the theorem, $f$ is an embedding.

Theorem An embedding $f: X \to Y$ maps $X$ diffeomorphically onto a submanifold of $Y$.

However, continuous functions preserves compactness, hence the image of $f$ is closed. The only closed and open subset of $Y$ is $Y$ itself. Hence $f$ is surjective. Therefore, since $f$ maps $X$ diffeomorphically onto a submanifold of $Y$, the submanifold is $Y$. And consequently, $f$ is a diffeomorphism.

Acturally, it should also be noted that the dimension of $M$ plays a critical rule, since the claim $f$ is open is a consequence of the invariance of domain. The problem can be split into a few well-known results:
(1) Let $U\subset \mathbb{R}^n$, if $f:U\to f(U)\subset \mathbb{R}^n$ is a diffeomorphism, then $f(U)$ is open in $\mathbb{R}^n$.
(2) If $f:M\to N$ is a local diffeomorphism between two compact connected manifolds, then $f$ is a smooth covering map.
(3) Let $f:M\to N$ is a covering map between two manifolds. Further suppose that $N$ is simply connected, then $f$ is a diffeomorphism.
So for the problem given above, the dimension assumption guarantees that $f$ is indeed a local diffeomorphism not just a local embedding. The assumption that $n>1$ guarantees that $S^n$ is simply connected.
