I was “reading” Pugh’s Mathematical Analysis Chapter 2. There, he defines a metric space to be path connected if there exists a continuous function $f : [a,b] \mapsto M$ for all points $(p,q)$ such that $f(a) = p, f(b) = q$.
He then proceeds to prove that path connected implies connected.
Assume that $M$ is path-connected but not connected. Then $M = A ⊔ A^c$ for some proper clopen $A⊂M$. Choose $p∈A$ and $q∈A$. There is a path $f :[a,b]→M $ from $p$ to $q$. The separation $f^{pre}(A) ⊔ f^{pre}(A^c)$ contradicts connectedness of $[a, b]$. Therefore M is connected. $\blacksquare$
I don’t get what he means by the last line of his proof. I also attempted to try it on my own and landed up with a “different proof”.
Assume that $M$ is path-connected but not connected. Then $M = A ⊔ A^c$ for some proper clopen $A⊂M$. Choose $p∈A$ and $q∈A$. There is a path $f :[a,b]→M $ from $p$ to $q$. Now let $S = \{ x : f(x) \in A \}$ and let $s = \sup S$.
Now see that there exists sequences $(a_n)$ and $(b_n)$ such that $f(a_n) \in A$ and $f(b_n) \in A^c$ and both the sequence converges to $s$ “one from below” and “one from above”. By continuity of $f$ and the fact that $A$ is clopen we can see that $s$ lies in both $A$ and $A^c$ leading to a contradiction. $\blacksquare$
I also want to know if my “proof” is indeed correct as it seems different to the one given by the author.
Since $f$ is continuous and both $A$ and $A^\complement$ are clopen, $f^{-1}(A)$ and $f^{-1}(A^\complement)$ are clopen subsets of $[a,b]$. But they are proper subsets of $[a,b]$, their intersection is empty and their union is $[a,b]$. This is impossible, because it would mean that $[a,b]$ is disconneted.
Concerning your proof, what happens if $s=b$? How can you then approach $s$ from above? A similar remark applies if $s=a$.