Let the image of $f$, which is $f(X)$, have the subspace topology inherited from $Y$. Prove that $f: X \to Y$ is continuous if and only if $f: X \to f(X)$ is continuous.
If $f: X \to Y$ is continuous, then $f^{-1}(U)$ is open whenever $U$ is open in $Y$. So take a set $V$ open in $f(X)$ with the subspace topology. Then $V = f(X) \cap W$ for some open set $W$ in $Y$. If I can prove $V$ is open in $Y$, then I can use continuity of $f: X \to Y$ to finish this direction, but it seems $V$ is not necessarily open in $Y$ even though it is open in $f(X)$ (I just did some examples in my head). So how can I approach this direction?
If $f: X \to f(X)$ is continuous, then $f^{-1}(U)$ is open whenever $U$ is open in $f(X)$. So take a set $V$ open in $Y$. I have to show this $V$ is open in $f(X)$ with the subspace topology so that I can use continuity of $f: X \to f(X)$, but $V$ might not even be a subset of $f(X)$ ($V$ could be larger than $f(X)$), so I don't know how to approach this one either.