The first people to shave in space were the Apollo 10 astronauts. Which one however is unknown. You'd have to ask Thomas P. Stafford as he is the only Apollo 10 crew member still alive. Razors were allowed on multiple flights (such as Gemini and soviet missions) but Apollo 10 was the first time anyone actually shaved in space. This passage can be found here.
... the first in-flight shaving was done on Apollo 10
...
On Gemini [presumably after Gemini 7] through Apollo, the crews were issued with Gillette Techmatic safety razors but they apparently went unused until the flight of Apollo 10.
This is a picture of John Young shaving in-flight on Apollo 10.
