Any real-valued function on the positive integers with the prime integer topology (subbasis of sets of the form $U_p(b)=\{b+np:n\in \mathbb{Z}, p\nmid b\}$) is constant. This is on page 82page 82 of Counterexamples in Topology;Counterexamples in Topology; item 4 shows that this topology is $T_2$ and item $7$ both constancy of real-valued functions and connectedness.