From what I understand, for a continuous real-valued function defined on $[a,b]$, $f([a,b])$ is connected if and only if $f$ has the intermediate value property.
There is one side of this equivalence ($\implies$) that is well explained in my book, and easy.
However, the other side $(\impliedby$) is less easy for me.
If $f$ has the IVP then $\forall \lambda$ such as $f(a) <\lambda < f(b)$ we have that $\lambda \in f([a,b])$.
$f(a) \in f([a,b])$ and $f(b)\in f([a,b])$ but for me there are only two ways of showing that a set $I$ (whose endpoints are $e_1$ and $e_2$) is connected:
- either by saying that $\forall z$ between $e_1$ and $e_2$, $z$ belongs to $I$
- either by moving along $x$ and $y$ all over $I$, with $x<y$ and showing that $x<z<y\implies z\in I$
Here it is clear that the first method can't apply (since $f(a)$ and $f(b)$ are not endpoints of $f([a,b])$) and the second method seems to be a bit difficult to implement.
It’s not necessarily limited to $f(a)<\lambda<f(b)$, because it’s not necessarily the case that $f$ is monotonic increasing. Really, saying ‘$f$ has the IVP’ is the same as saying: ‘$f([a,b])$ is a (degenerate) interval’.
And it is a well known fact that (degenerate) intervals are the only connected subspaces of $\Bbb R$.
I’m not really sure what you’re doing in your own attempt, to be honest. Connectivity has a precise topological definition and in $\Bbb R$ we are lucky that it simplifies to the property of being an interval, and you seem to be trying to show an interval is interval.