Let $f : X \rightarrow f(X)$ be continuous and X connected. Then $f(X)$ is connected. Let $f : X \rightarrow f(X)$ be continuous and X connected. Then $f(X)$ is connected.

I'm coming across a major problem with the following proof:

Suppose $f(X)$ is not connected. Then $\exists$ non-empty sets $U,V$ open in $f(X)$ such that $f(X) = U \cup V$, and $U,V$ are disjoint.
Since $f$ is continuous, $f^{-1}(U)$ and $f^{-1}(V)$ are open in $X$ (where $f^{-1}$ is the pre-image). We want to show $f^{-1}(U)$ and $f^{-1}(V)$ disconnect X for a contradiction.

It is now easy to show that X is the union of $f^{-1}(U)$ and $f^{-1}(V)$ and that $f^{-1}(U)$ and $f^{-1}(V)$ are non-empty. However, it seems to me that $f^{-1}(U)$ and $f^{-1}(V)$ are disjoint if and only if $f$ is 1-1. Am I mistaken?
$f^{-1}(U)\cap f^{-1}(V)=f^{-1}(U\cap V)=$
$f^{-1}(\emptyset)=\emptyset$
because it is always true that the intersection of the inverse image with respect to a function is the inverse image of the intersection
In general for connected proofs, it is much easier to argue by contradiction. So we shall assume for the sake of contradiction that $f(X)$ is not connected. Hence, we see there exists $B_1, B_2$ where both are non-empty such that $\overline{B_1} \cap B_2 = \emptyset$ and $\overline{B_2} \cap B_1 = \emptyset$ such that $f(X) =B_{1} \cup B_{2}$.

Now we want this to show that $X$ is not connected. So how do we go from our function back to $X$? Well we shall consider the pre-image.

Let $X_1$ = $f^{-1}(B_1) \cap X$, and let $X_2$ = $f^{-1}(B_2) \cap X$. It should be intuitively that these sets make $X$ not connected.

Now we claim that $X = X_1 \cup X_2$. Indeed, $X_1 \cup X_2 = (f^{-1}(B_1) \cap X) \cup (f^{-1}(B_2) \cap X) = f^{-1}(B_1 \cup B_2) \cap X = f^{-1}(f(X)) \cap X = X \cap X = X. $

Now we consider $\overline{X_1} \cap X_2 = \overline{(f^{-1}(B_1) \cap A)} \cap (f^{-1}(B_2) \cap A) \subset \overline{f^{-1}(B_1)} \cap f^{-1}(B_2)$

Now here's the crucial need of continuity: $f: X \rightarrow Y$ is continuous if and only if for every $B \subset Y$ $\overline{f^{-1}(B)} \subset f^{-1}(\overline{B})$ (for the proof of this, it should be in the beginning of Rudin's chapter on continuity). Hence, we see

$\overline{f^{-1}(B_1)} \cap f^{-1}(B_2) \subset f^{-1}(\overline{B_1}) \cap f^{-1}(B_2)$ =$ f^{-1}(\overline{B_1} \cap B_2)$  = $f^{-1}(\emptyset)$ = $\emptyset$, so we have $\overline{B_1} \cap B_2 \subset \emptyset$. S we see $\overline{B_1} \cap B_2 = \emptyset$. 

Now repeat the above proof for $\overline{B_2} \cap B_1$. Now we have shown $X = B_1 \cap B_2$ where $\overline{B_2} \cap B_1 = \overline{B_1} \cap B_2  = \emptyset$, so $X$ is disconnected, but this is our desired contradiction.