The question:
Let $X$ be a space such that every continuous function $f:X\rightarrow\mathbb{R} $ does have the following property:
if $a<c<b$, $f(x) =a$, and $f(y) =b$, then there exists $z\in X$ such that $f(z) = c$. Prove that X is connected.
My answer:
All continuous functions have the IVP which means that they (the continuous functions) do not map to a two point discrete space which implies connectedness.
Is this correct?