for your first question, the general ideal gas equation (PV = nRT) is derived from 3 gas law (Charle's, Boyle's, Guy's). This equation describes how each state property (P,V,T) varies with each other. A real gas behavior can be approximated as an ideal gas at low pressure or ambient conditions. the ideal gas law equation can be written in 2 equivalent forms:
1. PV = nRT
2. PV = NkT
R is the universal molar gas constant and k is the stefan-boltzman constant. n is the number of moles of the perfect gas, whereas N is the number of molecules, thus N/n = L (Avagadro's Constant) and R/k = L. Thus u can see why nR = Nk
for your 2nd question, the general ideal gas equation is a convenient mean to find the number of moles (n = PV/RT) of chlorine gas. Moreover, the conditions stated in the question corresponds to ambient condition, so the ideal gas approximation is valid. The mass of the chlorine gas is just the number of moles multiply by its molar mass.