Shares teetered between gains and losses, another sign of the volatility that’s become a hallmark of the market