I just bought used v50 T2.5 I put 87 octane gas in it will it hurt it
No, not at all, the car uses a knock sensor to help with detonation.
My check light came on thats why I asked
Have the car scanned for the code, might be a lose gas cap code or just a coincidence. OR someone who sold you the car cleared the code before you drove off.