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.