How is set theory part of logic? My textbook says "The part of logic in which classes and their properties are examined is called the theory of classes" (classes means sets)
 A: In some sense, set theory is a mathematical pursuit like any other: we have some axioms describing mathematical objects, and we try to prove theorems about them. This is only logic to the same degree that all mathematics is logic. This is the point of view Mauro refers to in the comments above. 
But mathematical logic is the field of mathematics that pays particular attention to the language we use to talk about mathematical objects (definability) and the ways in which we reason about them (provability). And I can think of (at least) three reasons why set theory is usually considered a subfield of mathematical logic. 


*

*At the most basic level, we define a set by collecting together the objects which satisfy some property. To make "some property" precise, we need to have a language in place for specifying properties, and that puts us squarely in the realm of logic. This is reflected in the ZFC axioms by the axiom schema of separation: we have one axiom for every formula in the first-order language of set theory. I think this point of view is the one your textbook is referring to.

*Set theory is commonly used as a foundation for mathematics. So we care not just about set theory on its own, but about our ability to interpret the rest of mathematics in set theory. This means that we want, at least in principle, to be able to translate proofs from all of the rest of mathematics into proofs in the language of set theory. Again, thinking about proofs and interpretations is definitely logic! 

*Finally, due to the foundational nature of set theory, we run into incompleteness phenomena much more frequently in set theory than in other areas of mathematics. That is, it's much more common for a natural question in set theory to be undecidable from our axiom of mathematics than it is in, say, number theory. As a result, a lot of research in set theory is about provability. Instead of proving theorems in ZFC (though set theorists certainly do this), a set theorist will often prove that some theorem is not provable in ZFC, or that some additional axiom beyond ZFC is necessary to prove some theorem. That's logic!
A: A basic answer. I do not claim that the reasons I give here are correct. What I mean is that they could explain ( or have been thought to explain, in the past) why set theory can be considered as a part of logic. 



*

*Suppose you want to prove that  " The complement of A U B " is " the intersection  of complement of A and of complement of B". 


This is a set-theoretic law. 
In order to prove it, you will translate this sentence into the membership language and say that : (it is false that x belongs to A OR x belongs to B) is equivalent to (x does not belong to AND x does not belongs to B). 
And to prove this, you will use a law of logic, namely: DeMorgan's law. 


*

*In the same way, the content of the idea of " inclusion" in set theory can be reduced to the logical notion of " implication" : A is included in B can be translated ( and in fact is defined) as : for all x,  x belongs to A --> x belongs to B. 

*Another possible explanation : 
(1) logic deals with the validity of reasoning 
(2) set theory explains the validity of a certain type of reasoning, namely, reasonings dealing with sets
(3) hence, set theory is a part of logic. 


*

*Still another explanation :


(1) logic is the theory of attributive judgments ( s IS P) 
(2) there is a perfect correspondance between attributive judgments and membership judgments ( this is the reason why Peano choosed the symbol " episilon" for " is a member of" , epsilon being the first letter of the greek verb " to be" ) [ Note: this alledged perfect correspondance has collapsed whith the discovery of Russell's paradox: in fact being P does not amount to being a member of the set of P's] 
(3) therefore : set theory is simply mirroring logic in the realm of sets, set theory is a part of logic. 
See: in Windelband's Encyclopedia Of Philosophiacl Sciences, ( at archive.org) the chapter on Logic by Louis Couturat , more precisely: " The logic Of Concepts": every concept is a propositional function, and it is an axiom of logic that" corresponding to every propositional function is a class which constitutes its extension". 
https://archive.org/details/encyclopaediaoft00unknuoft/page/n170/mode/1up
Louis Couturat was a french follower ( and friend) of Bertrand Russell. 
