China is stockpiling, taxing and imposing ever-smaller export quotas on rare earths — the 17 obscure chemical elements without which many industries would grind to a halt.