50cm³ of water containing 2g of caffeine was extracted with 3cm³ of ether. Given that the partition coefficient between ether and water is 8, calculate the mass of caffeine extracted

I assume you mean mass caffeine extracted IN THE ETHER LAYER.

k = 8 = (organic layer)/(water layer)
(organic layer) = x g caffeine/3 cc
(water layer) = [(2-x)/50]
Plug these into the k = 8 equation above and solve for x = g caffeine in the ether layer. Post your work if you get stuck.