Let $G$ be a graph. Prove $G$ is connected iff $G$ is connected as a topological space.
My attempt:
"$\Rightarrow$": Suppose $G$ is connected as a graph. Then all vertices of $G$ are path-connected which in turn implies $G$ as a topological space is path-connected. Then G is also connected.
"$\Leftarrow$": I'm stuck on this implication. I was thinking maybe it would be easier to prove that if $G$ is not connected implies $G$ is not connected as a topological space but no luck so far.
Any help is appreciated!
If is the union of two or more components, then it's the union of pairwise disjoint closed subsets, so your idea works.