Let be M a metric space with the property of Intermediate Value. Show that M is connected.
property of Intermediate Value: "all continuous function $f: M \longrightarrow \mathbb{R}$ that admit a positive value and a negative value, also admit a $c \in M$ such that $f(c) = 0$".
I think that I need to use the fact that open balls are connected (take an open ball with center $f(c)$ in $\mathbb{R}$ in this case) and suppose by absurd that $M$ is disconnected, but I dont know how use this exactly and if this right way to prove that $M$ is disconnected. Can anyone give me a hint on how to solve this problem? Thanks in advance!