I have this problem and I don't know how to proceed with it:
Let $M$ be a compact manifold $N$ a connected manifold and $f\colon M \longrightarrow N$ a smooth function. If $f$ doesn't have critical points, then prove that $f$ is surjective.
What I know is that since $f$ doesn't have critical points, all the points in $N$ are regular. Since $M$ is compact, then $f(M)$ is compact too. Now, if $n\in N$ is a point such that $n\notin f(M)$, then I can define the function $g\colon M \longrightarrow \mathbb{R}$ where $g$ defines the shortest lenght from $x\in M$ to $n$, I know that this function must have a maximum and a minimum, but from this the only thing I can infer is that there is an open neighborhood for $n$ in $N$. What can I do to finish the problem?
EDIT: $M$ and $N$ are of the same dimension.