The chick's lungs are not functioning and it is not breathing until after it pips internally into the air cell. It is just like a mammal or human baby inside the uterus, it does not breathe until it gets out. The oxygen is supplied directly to the blood through the placenta and umbilical cord and completely bypasses the lungs. The chick will breathe the air that is inside the air cell once it is pipped into that, and it is theorized that the rising level of carbon dioxide in there is what causes muscle spasms which cause the chick to break its shell to find air. I assume there is some gas exchange through the shell, as it is porous, but it would not be enough that the chick could live in there like that indefinitely, it has to come out for fresher air eventually--like you sitting inside a closed box with just a few tiny airholes, eventually you're going to get pretty uncomfortable.