I want to replace this old shutoff valve under my sink, but I don't know what kind to get or what precautions to take
I can't say I have seen those before. Does it looked like they are glued on? Then it would be PCV or CPVC (if its hot water). You could try going to home depot (yes, they can help) during the day when the best plumbing associate will be there. Also you could try a plumbing supply store.
Have you heard of the SharkBite system? Those may help you out. You can get a valve that will slide onto to the pipe if you can get the old one off. Also, you can get cap that will slide on. I recommend buying the sharkbite removal tool if you put on a cap and want to take it off.