Let $D\subset \Bbb R$.Let $f:D\to \Bbb R$ be continuous .
Prove that $D$ is connected if the set $A=\{(x,f(x)):x\in D\}$,the graph of $f$ is a connected subset of $\Bbb R^2$
I don't know how to proceed.
I assumed $D$ to be disconnected and then took a continuous surjective function $g:D\to \Bbb \{0,1\}$ .
I want to use $g$ to get a continuous surjective function $h:A\to \Bbb \{0,1\}$ which would prove $A$ disconnected and hence a contradiction.
But I am unable to do that.Please help me out.
Hint: Show that if $f$ is continuous, then the map $\phi:A\to D$ given by $\phi(x, f(x)) = x$ is a homeomorphism, and thus preserves connectedness.