Let $(X,\tau)$ be a a topological space.Let us define a new type of connectedness (I don't know if this has already a name)
Pseudo connected: $(X, \tau) $ is said to be pseudo connected iff image of every continuous map $f:X\to \Bbb{R}$ is an interval.
Lemma: Every connected space is pseudo connected.
Sketch:
Continuous image of a connected set is connected.
Connected subsets of $(\Bbb{R},\tau_{\text{euclidean}})$ are (precisely) intervals.
Conjecture: A pseudo connected space is connected.
I am trying to disprove.
Let $|X|\ge 2 $ and $p\in X$.Consider the topology $\tau_p=\{U\subset X : p\in U\}\cup\{\emptyset\}$
Claim: Every continuous map $f:X\to \Bbb{R}$ constant.
Sketch : Let $f:X\to\Bbb{R}$ continuous and $\exists x_0\in X$ such that $f(x_0) \neq f(p) $.
Then by $T_2$ property of $(\Bbb{R}, \tau_{\text{euclidean}}) $ , $\exists U, V\in\tau_{\text{euclidean}}$ such that $f(x_0) \in U, f(p) \in V$ and $U\cap V=\emptyset$.
By continuity of $f$ , $f^{-1}(U), f^{-1}(V) \in\tau\setminus \{\emptyset\}$ implies $p\in f^{-1}(U), f^{-1}(V)$ implies $f(p) \in U\cap V$ , contradict $U\cap V=\emptyset$.
Hence $f(x) =f(p) $ for all $x\in X$.
Hence image of every continuous map $f:(X\tau_p) \to\Bbb{R}$ is an interval (degenerate interval, $[f(p), f(p) ]$)
Hence $(X, \tau_p) $ disprove the conjecture.
Immediate edit: I haven't checked the connectedness of $(X, \tau_p) $. Infact $(X, \tau_p) $ is connected as a nonempty open set must contain the point $p$ and a proper closed set doesn't contain the point $p$ .
Hence $(X, \tau_p) $ doesn't have any proper non empty clopen set.
Conclusion: The above example can't disprove the conjecture.
Let $(X, \tau) $ is not connected, then $\exists A\subset X$ such that $\emptyset\subsetneq A\subsetneq X$ and $A, X\setminus A\in\tau$
Consider $\chi_A:X\to\Bbb{R}$ defined by $$\chi_A(x) =\begin{cases}1&x\in A\\0&\text{otherwise}\end{cases}$$
Then $\chi_A:X\to\Bbb{R}$ is a continuous map but $\chi_A(A)=\{0, 1\}$ is not an interval.Hence $(X, \tau) $ is not pseudo connected.
Contrapositively $(X, \tau) $ pseudo connected implies $(X, \tau) $ connected.