By the
definition of "f: (X, T)-> (Y, D)" if x is any point in x, then f(x) is in Y. Since "f^-1(A)" is defined as the set of all x such that f(x) is in A, it follows that f^-1(Y)= X. But is "D" the
discrete topology or the
indiscrete topology? To prove that as function is continuous, you must prove that f^-1(A) is open for every open A. It is the
indiscrete topology in which only Y and the empty set are open, NOT the discrete topology.
Your statement "for all the open sets in the topological space (A,T) there is some open set V in (Y,S) such that f^-1(V) is equal to that set" is not true. The definition of f

X,T)->(Y,S) "continuous", for every open set V in (Y,S) f^{-1}(V) is open. It does NOT follow that "given any open set, U, in X, there exist an open set V in (Y, S) so that f^-1(V)= U". For example, let f be the function that maps every point in X into a single point, y, of Y. Then f^-1(V) is either all of X or the empty set, depending upon whethere y is in V or not.
Let f1= f restricted to A. If V is any subset of Y, then [itex]f1^-1(V)= f^-1(V)\cap A[/itex]. If V is open, then f^-1(V) is open so f1^-1(V) is an open set intersect A. What is the definition of "open" in the topology inherited by A?