Wash the wall well with mild detergent in an inconspicuous spot. Rinse it with clean water, then dry with a towel. You don't want to get a false result with a dirty wall.
Soak a cotton ball in denatured alcohol. Rubbing alcohol works fine.
Rub the cotton ball over the clean spot.
Look at the cotton ball. If you see paint on the cotton ball, it's latex. You can paint over it with a latex paint. If there's no paint on the cotton ball, it's oil based. You'll need to use an oil-based primer to cover the paint. You can then follow with an oil-based or latex paint.