Let $M$ be a compact smooth manifold (without boundary). Prove: there exists a Morse function $f$ on $M$, such that $f$ takes different values at different critical points.
This is an exercise on the chapter about vector fields, flows and Morse functions in a Differential Topology book (Chinese version).
Definition. A smooth function $f:M\to\mathbb R$ is called a Morse function if all critical points of $f$ are non-degenerate: if $p\in M$ is a critical point, and $(U,\varphi)$ is a local chart around $p$, then the Hessian of $\tilde f=f\circ\varphi^{-1}$ is non-degenerate at $\varphi(p)$, i.e., $$\mathrm{det}\left(\frac{\partial^2\tilde f}{\partial x^i\partial x^j}(\varphi(p))\right)\neq0.$$
My thoughts. Firstly, since $M$ is compact, $f$ must take its maximum and minimum on $M$, so we have at least two critical points. Hence, a natural idea is: can we construct a Morse function with only two critical points? The answer is no, because of Reeb's sphere theorem, which sates that if there exists a Morse function on $M$ with only two critical points, then $M$ is (topologically) homeomorphic to the sphere! What’s more, I constructed a Morse function on $S^n$ with only two critical points. That is the height function: $f(x_1, \cdots, x_{n+1})=x_{n+1}$ for $x\in S^n\subset \mathbb R^{n+1}$. It can be verified using the definition and stereographic local charts. However, what about general manifolds?
I'm not good at geometric stuffs. If my question is silly, forgive me please. Any help would be appreciated!