I have written a proof of the proposition (that the continuous image of a connected set is connected) slightly different from the ones on here so far (of which I am aware there are many). Is the following correct?
I have a continuous function $f:X \rightarrow Y$, where $X$ and $Y$ are metric spaces such that $X$ is connected. I want to show that $f(X)$ is connected as a metric space, with the metric induced by $Y$.
Suppose, for a contradiction, that $f(X)$ is not connected. That is, there exists open sets $A,B$ such that $f(X)=A\cup B$ and $A \cap B = \emptyset$. Note that $A,B\subseteq Y$, and so, by the continuity of $f:X \rightarrow Y$, $f^{-1}(A)$ and $f^{-1}(B)$ are both open in $X$. Additionally, $f^{-1}(A)\cap f^{-1}(B)= \emptyset$ (since, otherwise, $\exists x^*$ such that $x^*\in f^{-1}(A) \cap f^{-1}(B)$ and so $f(x^*)\in A \cap B$, contradicting the assumed disjointedness of $A$ and $B$). Finally, we show that $X=f^{-1}(A)\cup f^{-1}(B)$.
$w\in f^{-1}(A)\cup f^{-1}(B) \iff f(w) \in A \cup B = X \iff w\in X$.
So $X=f^{-1}(A)\cup f^{-1}(B)$, and is not connected. A contradiction.