I understand that polarity corresponds to an electronegativity difference and that the larger the electronegativity difference, the more polar the bond.
However, I have read that carbon dioxide is nonpolar. This doesn't make sense to me.
In carbonyl compounds, the carbonyl carbon is partially positive and thus carbonyls are polar. $\ce{CO2}$ is simply two such units bonded together, so wouldn't it be that you would have an even more positive carbon and two partially negative oxygens causing $\ce{CO2}$ to be overall polar?
On top of that, $\ce{CO2}$ dissolves to a much larger extent in water compared to $\ce{O2}$, despite both molecules supposedly being nonpolar.