Continuous functions Let $X$ and $Y$ be topological spaces and $f$ a function of $X$ into $Y$. Show that $f$ is continuous if and only if es continuous as a function of $X$ onto the subspace $f(X)$ of $Y$.
I'm proceding like this:
First, assume that $f$ is continuous of $X$ into $Y$, let $f(X) \cap A$ be an open set of $f(X)$, where $A$ is open in $Y$.
So $f^{-1} (f(X)\cap A)=f^{-1}(f(X)) \cap f^{-1}(A)$, $ f^{-1}(A)$ is open because $f$ is continuous , and $X=f^{-1}(f(X))$ because $f$ is a function of $X$ into $Y$, so $f^{-1} (f(X)\cap A)$ is open.
¿Am I proceeding right? , and ¿How can I prove  the reverse?, I know that it's a easy problem but I'm stuck.

If you like to be pedantic, one could say this is an immediate consequence to the characterisation of continuity of maps into a space with the initial topology. I.e. if we have $f: X \rightarrow Y$ and $i: f[X] \rightarrow Y$ is the inclusion map, and $\tilde{f}: X \rightarrow f[X]$ is the image restriction of $f$, so $\tilde{f}(x) = f(x)$ for all $x \in X$, then $i \circ \tilde{f} = f$ and $f$ is continuous iff $\tilde{f}$ is, by the initial topology fact ($f[X]$ has the initial topology w.r.t. $i$, being a subspace topology).
