On isometries of inner product spaces