It seems to me that you are glossing over what "f restricted to A" continuous means. In particular the only way to make sense of this is to put the relative topology on A. Then of course an open sets of A is the intersection of an open set in X with A, similarly for a closed set of A.
I think the easiest proof is to show for F closed in Y, f-1(F) is closed in X. If you have question about proceeding in this direction, post your problem.