Due to the reminder Theorem P(1) and P(-1) will give the reminders of dividing by x-1 and x+1 respectively
For the polynomial to have the same reminder when divided by either (y-1) or (y+1) you need to make P(1) = P(-1) and solve for m:
1^3+1^2+1*m -7 = (-1)^3+(-1)^2+(-1)*m -7
1+1+m-7 = -1+1-m -7
2m = -2
m = -1
Now to find the actual reminder in both cases we have to put the value of m that we just found into the polynomial.
We will get: y^3+ y^2 + (-1)y -7 = y^3+ y^2 -y -7
Now let's divide it by y+1 and y-1
y^3+ y^2 -y -7 / y-1 = -6 and same answer is for y^3+ y^2 -y -7/y+1 = -6
If you will just divide y^3+ y^2 +my -7/y-1 or y^3+ y^2 -y -7/y+1 you will get ( -m-7 ) in both cases and if you use above mentioned Polynomial Remainder Theorem and method to find the value of m, you will get -(-1) -7 = -6.
Hope this explains it.
Let me know if you have any questions or if you would want me to explain any of this even in more detail.