Suppose $f$ is a continuous mapping from a compact metric space $X$ into a metric space $Y$. Prove that if $F$ is a closed subset of $X$, then $f[F]$ is a closed subset of $Y$.
Here is my idea for the proof: The continuous image of a connected space is connected. Use the intermediate value theorem to show that the image of every continuous real-valued function is an interval, and should return closed sets into closed sets.
Corrections are appreciated!
First let me tell you the flaws in your argument. 1) nobody said anything about $X$ being connected. 2) You never used compactness of $X$. 3) You are using a property of "real" valued functions, these are metric spaces, which are much more general than real spaces.
Here's how you do it. Take any open covering for $f(F)$ in $Y$, say $\{U_\alpha\}_{\alpha \in I}$ ($I$ possibly infinite index set). Since $f$ is continuous $f^{-1}(U_\alpha)$ is open in $X$ for every open set in the cover. Moreover $\{f^{-1}(U_\alpha)\}$ covers $F$. But $X$ is compact, so there is a finite subcover, say $\{f^{-1}(U_i)\}_{i=1, \cdots, n}$ covering the whole $F$, i.e. $F\subset \bigcup_{i=1}^n f^{-1}(U_i)$. Then $\{U_i\}_{i=1, \cdots, n}$ covers $f(F)$. So any open cover of $F$ has a finite subcover. Hence $f(F)$ is compact. Any compact subspace of a metric space is closed and bounded, so $f(F)$ is closed.