let $X$ be a pathconnected space. Suppose $X$ is not connected. Then $X=X_1\sqcup X_2$ where $X_1$ and $X_2$ are non empty disjoint open subsets of $X$. Now take a point $x_1\in X_1$ and $x_2\in X_2$ then there is no way to join these two points by a continuous path, which contradicts the pathconnectedness hyposthesis of $X$.