I'll explain the difference between A and B. Hopefully you can work out the rest by yourself.

First, we see that . What does this mean in human language? This says that the set A has two elements: a and b.

Next, we have that . This says that the set B has two elements, {a} and {b}.

I suppose your confusion then comes from the difference between a and {a}. It may be useful to think of a set as a plastic bag and the elements a,b as coins (perhaps a 10cent and 5 cent coin). Using this analogy, is a plastic bag containing the a 5 cent piece and a 10 cent piece. That is, when you open the plastic bag A, you find the two coins a and b. On the other hand is a plastic bag containing two other plastic bags (each containing one type of coin).

In view of this analogy, you can say that A and B are actually different sets: one contains the elements a,b, the other contains the singletons of a,b (we call single element sets singletons).

Of course, you must be aware that this analogy is not perfect: The set {a,a} and {a} are equivalent since a set cannot have repeat elements. So everything in your plastic bag must have some distinguishing feature to tell them apart. For example {a,{a}} is a two element set since a is a 10 cent coin and {a} is a plastic bag wrapped around a 10 cent coin, so you can distinguish between the two).

I hope this helps.