Stocks give up gains, end lower following inflation report