Assume $f(D)\subset U\cup V$ where $U,V$ are open sets in $\Bbb{C}$. $f$ being continuous the inverse image of an open set is an open set and so $f^{-1}(U),\,f^{-1}(V)$ are therefore open sets in $\Bbb{C}$.
Now take $x\in D$, one has $f(x)\in f(D)$ and this means $f(x)\in U$ or $f(x)\in V$ and so $x\in f^{-1}(U)\cup f^{-1}(V)$ and therefore $D\subset f^{-1}(U)\cup f^{-1}(V)$.
But $D$ is connected so it cannot be included in the union of two disjoint open sets and so $\exists a\in f^{-1}(U)\cap f^{-1}(V)$ and thus $f(a)\in U\cap V$. Therefore $U,V$ are not disjoint and $f(D)$ is connected.
I am stuck at the third paragraph, could someone explain why it must be that if a connected set can't be included in the union of two disjoint open sets? I get that the definition of connected is that it can't be equal to that but I don't get who it can't even take part!