Set theory for category theory beginners I am wondering how much set theory is needed to read the basics of category theory, and what (preferrably short) book would be recommended. 
Usually I would just use naive set theory without worrying whether something is really a set, so it bugs me quite a lot that we have small/locally small/large category where we need to specify certain things to be a set. I have never worked with axiomatic set theory before, and I don't think I am interested in going into the foundation deeply: I just want to know enough about/be comfortable with classes etc to read category theory or homological algebra.
I wiki-ed a bit and there seems to be different axioms for set theory. As classes are involved, I guess I should be looking at NBG or MK axioms.
So can anyone briefly tell me how much knowledge in set theory would suffice, or whether there are short notes/books that would serve this purpose. Thanks!
 A: Some of you may want simply to learn set theory, rather than learn set theory in order to do category theory. Therefore, I list here a few of the most canonical texts used by set theorists---these book are all fantastic.  None of them, however, is concerned with category theory at all.
Set Theory, by Thomas Jech. (3rd Millenium edition). This book is a standard graduate introduction to set theory, and covers all the elementary theory and more, including infinite combinatorics, forcing, independence, descriptive set theory, large cardinals and so on. It is used almost universally in any serious graduate introduction to set theory. Excellent text.
The Higher Infinite, by Akihiro Kanamori. This encyclopedic account of large cardinals is simply fantastic. It contains everything you wanted to know about essentially all the most well-known large cardinals. These cardinals form a very rich structure with a highly developed theory, including surprising connections even with the structure of sets of reals and much much more. Surely any talk of "universes" in category theory would be deeply informed by knowledge of the large cardinal hierarchy, and the far more nuanced and developed structure theory it provides for these concepts.
Set Theory: An Introduction to Independence Proofs, by Kenneth Kunen. This shorter book is an excellent companion to Jech's book, in that they have different approaches to many common problems. I always recommend my graduate students to play these books off against one another.
Of course, there are many others.
A: Dan Murfet has some notes on foundations for category theory which can be found  here. They contain an introduction to Grothendieck universes as well as some references for learning about NBG class theory.
If you are particularly interested in some more possible foundations and their pros and cons you might want to have a look at this blog post by Kenny Easwaran.
I think that if you only want to learn introductory category theory, especially for the purpose of doing homological algebra, one can often safely just pretend that size issues are not really issues. It is true that there are many technicalities involving size that can trip one up. However, I tend to see these as "just" technicalities especially from the point of view of how I think about category theory. Maybe this is a controversial point of view?
A: In my personal opinion, you do not need any set theory to learn the basics of category theory. Well, you need to know the meaning of the symbols $\in$ and $\subset$, because any mathematical paper will probably use them, but that is all.
Every once in a while, your introduction will probably use the word "class", or remark that we are working within a fixed universe. For the purpose of learning the basics, I claim you can ignore these statements. Just think of "class" as a large set, and "working within a universe" as "we are allowed to do reasonable set-theoretic constructions".
Certainly, it's worth eventually going back and learning what those terms mean. But I just looked at my bookshelf. The most intensely category theoretic books are FGA (together with "Fundamental Algebraic Geometry: Grothendieck's FGA Explained"), "Methods of homological algebra", "Introduction to Homological Algebra", Hatcher's "Algebraic Topology" and "A guide to Quantum Groups." I claim that you can understand any of these with only the most naive set theory.
I'd be curious to know what areas of category theory can't be handled in this naive manner.
A: In contrast to what some of the other answers seem to be saying, I believe that size issues play a very important role in category theory.  Consider, for instance, the notion of complete category, i.e. a category having all small limits.  Most "naturally-ocurring" categories, such as sets, groups, categories, etc. are complete (and cocomplete), and the ability to construct small limits and colimits is extremely important.  However, these are all large categories, and a classic proof due to Freyd shows that in fact any small complete category must be a preorder (i.e. any two parallel arrows are equal).  Thus, one of the most basic notions of category theory (completeness) becomes trivial if you aren't careful with size distinctions.
I also feel that more mathematicians should pay attention to set-theoretic issues, especially in category theory, and I wrote an unfortunately lengthy note myself on the subject, akin to Murfet's and Easwaran's pages linked to in Greg's answer.
However, for purposes of learning category theory, I don't think one should pay too much attention to any of this stuff.  I think all you need to know, beyond naive set theory, is that some collections are "too big to be sets" (like the collection of all sets) but we can still manipulate them more or less as if they were sets, and we call them "classes."  NBG and MK formalize this nicely with the "Limitation of Size" axiom: a class is a set if and only if it is not bijective with (i.e. "is not as big as") the class of all sets.
A: I recommend "Set Theory", by Pinter. It is a very concise book, and if I am not mistaken, it uses basically von Neumann's approach to classes and sets (you asked for NBG class theory). You will only need to read the relevant (short) chapter there to feel very comfortable with sets and classes. And if you will want to learn about cardinality issues - you'll find it there in concise form.
This is not the book I would reccommend to someone who knows no math and would like to learn set theory, but for you I recommend it.
A: See Sets for Mathematics by Lawevere and Rosebrugh.  Its a great book, but it is misnamed.  It should have been called something like "An introduction to category theory via set theory."  The point of the book really is category theory, not set theory.
A: Personally I found the language of sets and classes confusing, just as you describe.  I've never been sure precisely what operations on classes are allowed.  For instance some textbooks mention the category of all functors from Set to Set as an example of a category which isn't locally small; but it seems to me that it's not a category at all, because its collection of objects is too large to even be a class.
I'm much happier with the formalism of Grothendieck universes and the universe axiom: Every set is contained in some Grothendieck universe.  Typically we choose a universe U and agree that Set denotes the category of elements of U (or sets whose cardinality is an element of U).  Then there's no problem in forming the functor category [Set, Set], and using ordinary set theory we can see that its Hom sets are indeed too big to be elements of U.
For related discussion see my question here.
A: Several generations of mathematicians, working and otherwise, learned their portion of axiomatic set theory and foundations from the appendix to John L. Kelley's General Topology.  It was still in print the last time I checked, and I remember liking it a lot.
Note on provenance.  "The system of axioms adopted is a variant of systems of Skolem and of A.P. Morse and owes much to the Hilbert–Bernays–von Neumann system as formulated by Gödel."
If you like that sort of thing …
A: Lawvere and Schanuel's Conceptual Mathematics is a good introduction to category theory that assumes an absolute minimum of set theory. Peter Cameron's Sets, Logic and Categories, on the other hand, is a good introduction to sets and logic (albeit far too short), but his chapter on category theory is woefully short and would be unhelpful to anyone who doesn't already understand categories a little bit.
A: Don't learn classical set theory if you want to do category theory.  There are a few "set theories" that are better-suited for category theory, for a list, check out the page "Set Theory" on nLab.  
And also, you don't really need to learn set theory for category theory.  While there can be size issues etc, arrow-theoretic language is completely different from set-theoretic language.  The fact is, set theory is much easier and less abstract than category theory, and you don't want to settle into your nice set theoretic world just to have it all blown away once you start doing category theory.  
For example, in set theory, all injective maps ($f:X\rightarrow Y$) (monomorphisms in the category of sets) admit a left inverse ($g:Y\rightarrow X$ such that $g \circ f = id_X$).  This is not true in a general category.  That is, the morphisms with this property in a general category aren't only monomorphisms, they're split monomorphisms, so set theoretic intuition absolutely fails here.  There are countless other examples, but I'm sure you see my point.
