(I have asked this question at math stackexchange, it was upvoted but got no answers; maybe you can help.)
It is well-known that $\beta_1(R(f))\le\beta_1(X)$, where $\beta_1$ is the first Betti number (number of loops), $X$ is a topological space, $f:X\to\mathbb R$ a continuous funcion, and $R(f)$ its Reeb graph, i.e., the space of contours of $f$ (connected components of levels of $f$): see, e.g., Computational Topology: An Introduction by Edelsbrunner & Harer, page 141.
However, the commonly given argument looks flawed to me: it is said that the dimensionality of the space of images of all 1-cycles of $X$ in $R(f)$ does not exceed $\beta_1(X)$, but why cannot $R(f)$ have other 1-cycles not induced from any 1-cycle of $X$?
For example, the height function $f$ on a Warsaw circle (a topologist's sine curve including a segment at the "bad" place, not just a point; plus a piece of a circle) $X$:
is continuous and the $R(f)$ is a circle, $\beta_1(R(f))=1$, while $\beta_1(X)=0$ (here, Remark 2.7 on page 7). While it is true that the projection in $R(f)$ of any cycle in $X$ is zero, $R(f)$ has a cycle not projected from any cycle in $X$.
Where am I wrong?
And even if this particular counterexample is wrong, still how to prove that $R(f)$ does not have other cycles?