If U is wholly contained in S and open/closed in T it is open/closed in S. Restricting to S can only increase the number of open sets in S. This is a refinement of the topology on S. If S is a closed square in the plane, and U is an open disk that overlaps the square, the half disk, with the square's edge, is open in the square, but not in the plane. It represents a new open set in S.
If U is closed in S is closed in T then U is closed in T. Let W be the open set in T such that W∩S is open, with complement U in S. Union W with the complement of S in T and you have an open set in T whose complement is U. Similarly, if U is open in S is open in T, U is open in T. Let W∩S create U, where W is open, and intersect W and S to show U is open.