Let $f:X\rightarrow Y$ be a continuous map from one metric space $(X,d_{X})$ to another $(Y,d_{Y})$. Let $E$ be any connected subset of $X$. Then $f(E)$ is also connected.
My solution
Suppose otherwise that $f(E)$ is disconnected. Thus $f(E) = U\cup V$, where $U$ and $V$ are open, disjoint and nonempty sets.
Since $E \subseteq f^{-1}(U\cup V) = f^{-1}(U)\cup f^{-1}(V)$ where $f^{-1}(U)$ and $f^{-1}(V)$ are open, nonempty and disjoint, we conclude that $E$ is disconnected, which is a contradiction. Consequently, the proposed result holds.
Am I reasoning correctly? Could someone provide an alternative way to prove it?
Here I am giving two ways to approach this problem.
Definition A (metric) space $X$ is said to be connected if the only sets which are both open and closed in $X$ are $\phi$ and the full space $X$ , when $X$ is a metric space.
Theorem-Let $X$ be a connected (metric) space and $g: X \to Y$ be a continuous map. Then $g(X)$ is connected.
Proof(1)-Let $f: g(X)\to \{±1\}$ be a continuous function on $f(X)$. Since $fog: X \to \{±1\}$ is continuous and $X$ is connected, it follows that $fog$ is a constant on $X$. Hence $f$ is a constant on $g(X)$. Therefore $g(X)$ is connected.
Proof(2) Assume that $g(X)$ is not connected. Then there exists nonempty proper subset $V\subset g(X)$ which is both open and closed in $g(X)$. Since $f$ is continuous, $g^{-1}(V)$ and $g^{-1}(g(X)-V)$ are both nonempty, closed and open in $X$. This contradicts the hypothesis that $X$ is connected.