I was thinking about this question today. Is the following true:
Let $X$ be a topological space with connected components $\{C_i\}_{i\in I}$. Let $Y$ be a topological space and let $f:X\rightarrow Y$ be a function. Then $f$ is continuous iff $$\forall i\in I, \;\{(x,f(x))\mid x\in C_i\}\text{ is a connected subspace of }X\times Y$$
The forward direction is easy, as $\{(x,f(x))\mid x\in C_i\}$ is the continuous image of the connected subspace $C_i$ (the mapping would send $x$ to $(x,f(x))$).
I am not sure if the backward direction is true for all topological spaces.
Thank you