Let $X$ be a topological space and consider a continuous function $f:X\to [0,+\infty)$. For $c\geq 0$ set $X\_c := f^{-1} ([0,c])$.
Furthermore, suppose that $X\_0 \neq \emptyset$ and $f$ is proper.


**Motivating example**
If $X$ is a closed manifold and $f$ is smooth and $0$ is a regular value, then $X\_0$ is a smooth submanifold and $X\_c\cong X\_0\times [0,1]$ when $c$ is small enough. Consequently, the cohomology of the pair $H^\*(X\_c, X\_0)\simeq (0)$.
If $X$ is a closed manifold and $f$ is smooth (without the assumption of $0$ being a regular value)the same still holds even if $X\_0$ now can have singularities, indeed we can consider the flow of the normalized gradient of $f$, $\Phi:X\times \mathbb{R}\to X$ which gives a retraction of $X\_c$ onto $X\_0$.


What can be said in the general case?



> 
> Is it still true that there for all $c$ sufficiently small $H^\*(X\_c, X\_0) \simeq (0)$? Does it hold at least when $X$ is a topological manifold?
> 
> 
> 



Vanishing of $H^*(f^{-1}[0,c], f^{-1}(0))$ for small $c$, and $f\in C^0(X, [0,+\infty))$
With this degree of generality I don't think you can say anything. Here are two pathological examples:


* If X is the [Hawaiian earring](https://en.wikipedia.org/wiki/Hawaiian_earring) and $f(x,y) = x$, then for any $c>0$, $f^{-1}([0,c])$ retracts on a copy of the Hawaiian earring (hence has very large $H^1$).
* If X is $\mathbb R^2$ and
$f(x,y) = e^{\frac{-1}{x^2+y^2}}h(x^2+y^2)$ where $h$ is a smooth positive bounded function on $\mathbb R\_{>0}$ that oscillates very fast near $0$, then there are arbitrary small values $c$ such that $f^{-1}([0,c])$ has small will have a connected component which is an annulus (hence has non-zero $H^1$). Choosing $h$ carefully enough, you can even arrange so that this is true for all $c$.


