Part A)
There are 52 cards total. There are four suits with each suit having the same value labels (eg: each suit has a '4' card). If you select 13 cards, then there is a chance you got a pair in there somewhere. However, there's also a chance that NONE of the cards are repeats. So it's possible, though very unlikely, to pick out a full suit with no repeats.
If that unlikely scenario happens then you just need to pick one more card to guarantee you have one pair. That 14th card will be a repeat of some other card just of a different suit (eg: 2 of hearts and 2 of spades)
Final Answer: 14 cards
------------------------------------------------------------------------------------
Part B)
Using the same logic of part A, we can pick out 26 cards and have each card be repeated (from 2 all the way up to ace). This is very unlikely not to have a three of a kind somewhere in there. If there are no three of a kinds, then simply pick another card to guarantee that one set of 3 cards are the same. This is effectively using the pigeon hole principle.
Answer: 27 cards