I've seen entirely set-theoretical solutions to this proof, but not many based on epsilon-delta arguments. I tried writing one, but am not sure whether my arguments hold.
Theorem: The image of a continuous mapping on a connected metric space is connected.
Proof: Let $\mathrm{(X,d_1)}$, $\mathrm{(Y,d_2)}$ be metric spaces, where $\mathrm X$ is a connected space, and let $f:\mathrm{X} \rightarrow \mathrm{Y}$ be a continuous mapping.
Assume that $f[\mathrm{X}] = \mathrm{P \cup G}$, where $\mathrm{P,G}$ are nonempty, disjoint, open sets.
$\mathrm{P}$ and $\mathrm{G}$ are disjoint $\Rightarrow \exists r>0$ such that $\mathrm{B(x,r)}\cap\mathrm{G} = \emptyset\space \forall x\in \mathrm{P}$.
$f$ is continuous $\Rightarrow$ $\forall \epsilon>0,\space\exists \delta>0$ so that if $d_1(x,y)<\delta \Rightarrow d_2(f(x),f(y))<\epsilon = \frac{r}{2}$ for all $x\in f^{-1}[\mathrm{P}], y\in f^{-1}[\mathrm G]$
$\Rightarrow \exists\epsilon < r \space\forall r>0 \Rightarrow\nexists \mathrm{B(x,r)}\cap\mathrm{G} = \emptyset$, which contradicts the assumption that $\mathrm{P,G}$ are disjoint and open.
$\Rightarrow \mathrm{P,G}$ are closed and not disjoint.
Now, there are a few questions I have: I tried using a point inside the open ball such that the distance between the point and the set G was minimised, and tried to show that $r < \epsilon$, but couldn't make it work, no matter what I tried. Is it viable?
Also, I feel like the proof is a bit cluttered, like something could be cleaned up, and concluding that P,G must be closed and disjoint, I feel like it should be phrased differently for clarity.
I'm afraid your proof doesn't work. Let $Y = \Bbb R$ with the usual metric, let $P$ be the negative reals and let $G$ be the positive reals (so there's a "hole" at $0$ that disconnects $P$ and $G$). It's not true that there is some $r$ that uniformly separates $P$ and $G$ (in other words, there's no $r$ that works for all $x \in P$, though for each $x \in P$ there is an $r$ that works).
But the statement is true in general, not just for metric spaces, and it's a pretty easy consequence of the definition of continuous in a general topological space: