Given a smooth function $f:M\rightarrow \mathbb R$ on a manifold, its local homology at a critical point $x$ is the group $$ C_\star(x) := H_\star ( M_{ < c} \cup \{ x \} , M_{ < c} ) ,$$ where $H_\star$ denotes singular homology (with any coefficient group), $c=f(x)$, and $M_{ < c}$ is the space of those points $x\in M$ such that $f(x) < c$.

If $x$ is a non-degenerate critical point, then $C_\star(x)$ is completely determined by the Morse index of $f$ at $x$: the group $C_j(x)$ is equal to the coefficient group of the homology for $j=\mathrm{ind} (x)$, and is trivial for other values of $j$.

If $x$ is degenerate, the knowledge of $\mathrm{ind}(x)$ and $\mathrm{nul}(x)$ (this latter being the nullity of $f$ at $x$) is not enough to determine $C_\star (x)$. It is easy to build examples of functions on $\mathbb R^2$ having a critical point $x$ with local homology $C_1(x)= G\oplus ...\oplus G$ ($k$ times, where $k>1$ and $G$ is the coefficient group) and $C_j(x)=0$ for $j\neq 1$. For instance, consider the function $f:\mathbb R^2\rightarrow\mathbb R$ given by $$ f(x,y)=(y-2x^2)(y-x^2)(y+x^2)(y+2x^2). $$ Here, the origin is a critical point whose local homology (say, with $\mathbb Z_2$ coefficients) should be $C_1(0)=\mathbb Z_2\oplus\mathbb Z_2\oplus \mathbb Z_2$ and $C_j(0)=0$ for $j\neq 1$.

Does anybody know examples of functions having critical points whose local homology is nonzero in more then one degree?

If the answer to the previous question is yes (as I would expect), is it true that given $(n_1,d_1), ..., (n_r,d_r)$ there exists a function $f:M\rightarrow\mathbb R$ with a critical point $x$ whose local homology is given by $C_{d_j}(x)=G^{ \oplus n_j }$ and $C_d(x)=0$ for $d\neq d_1,...,d_r$?