If $h$ is a diffemorphism, then $dh$ is everywhere nonsingular. Because
$$
d(f \circ h) = df \circ dh
$$
(depending on notation, etc. --- we're talking about the chain rule here), we have $d(f\circ h)(P)(v)$ is zero exactly when $df(Q)(w)$ is zero (where $Q = h(P)$ for some nonzero $w$, because $dh(P)(v)$ is never zero for any nonzero $v$, because $h$ is a diffeomorphism.
The one weird thing about this question is that "isotopic to the identity" is completely irrelevant; is there a part "b" or "c" that might use that assumption?
Here is a somewhat sketchy answer, based on the creed that Morse functions and (smooth) handles should be thought about interchangeably (and that Heegaard splittings are a form of handle decomposition).
Suppose $M$ is a closed, connected, orientable 3-manifold and $f:M\rightarrow [0,3]$ is a self-indexing Morse function. For $k=0,1,2,3$, let $c_k$ be the number of critical points of $f$ having index $k$. We can see that $c_1-c_0=c_2-c_3$, because $$0=\chi(M)=c_0-c_1+c_2-c_3.$$
Since $f^{-1}[0,1.5]$ is formed from $c_0$ zero-handles and $c_1$ one-handles, we can see that it is a handlebody of genus $c_1-c_0+1$ (this uses the assumption that $M$ is connected and orientable). Considering the upside-down Morse function $-f$, we can similarly observe that $f^{-1}[1.5,3]$ is a handlebody of genus $c_2-c_3+1$. So the genus of this particular Heegaard splitting is $c_1-c_0+1=c_2-c_3+1.$ If $c_0=c_3=1$, then the genus of this particular Heegaard splitting is $c_1=c_2.$
Suppose that our Morse function is minimal, i.e. it has $\mathfrak m(M)$ critical points. If we have $c_0>1$, then there are multiple zero-handles, which need to be glued together by 1-handles in order for $M$ to be connected. Hence, there is an index-one critical point $q$ whose two descending flow lines limit to two different critical points $p$ and $p'$ of index zero. Since there is exactly one flow line from $q$ to $p$, we can cancel these critical points, which contradicts the minimality of $f$. Thus, we must have had $c_0=1$ to begin with. We can see that $c_3=1$ by applying the same argument to $-f$. This proves that $$\mathfrak h(M)\leq c_1=\frac{2c_1+2}{2}-1=\frac{c_0+c_1+c_2+c_3}{2}-1=\frac{\mathfrak m (M)}{2}-1.$$ To see the reverse inequality, we need to prove that a genus $g$ Heegaard splitting gives rise to a Morse function $f:M\rightarrow [0,3]$ with $c_0=c_3=1$ and $c_1=c_2=g$. Letting $H_g$ denote a handlebody of genus $g$, we can define a self-indexing Morse function $h:H_g\rightarrow[0,1.5]$ having one index-zero critical point and $g$ index-one critical points, and satisfying $h^{-1}(1.5)=\partial H_g$ (because $H_g$ can be formed from a single zero-handle and $g$ one-handles). Then $3-h:H_g\rightarrow[1.5,3]$ is also a self-indexing Morse function having one index-three critical point and $g$ index-two critical points, and satisfying $(3-h)^{-1}(1.5)=\partial H_g$. Being careful to preserve smoothness, we can glue these two functions along the splitting surface of the Heegaard splitting to define the desired Morse function $f:M\rightarrow [0,3].$
Best Answer
Permit me to talk about the Morse complex over $\mathbb {Z}$. For $\mathbb{Z}_2$ a similar argument works.
A function whose Morse complex has trivial boundary maps is called a perfect Morse function. Finding perfect Morse functions is hard; To my best knowledge it is as open problem to characterize manifolds that admit perfect Morse functions.
Simple examples of manifold which will never have perfect Morse functions can be made as follows: Take a group $G$, whose abelianization is trivial. Construct a manifold $M$, with fundamental group $G$ (This is always possible if $G$ is finitely presented group for a manifold $M$ of dimension $4$). Then $H_1(M;\mathbb{Z})=G_{\mathrm{ab}}=0$. A perfect Morse function would not have critical points of index $1$. But since $\pi_1(M)=G$, this cannot be the case.