Pencils in space
They did for early flights - certainly for the Gagarin's flight, who famously lost the pencil while in orbit
I think these were chinagraph pencils, rather than graphite. Used in aviation even today.
Not it Gagarin's case: he apparently used a bog-standard graphite pencil. If you believe Wikipedia's article on writing in space:
The wood pencil has been used for writing by NASA and Soviet space programs from the start. It is simple with no moving parts, except for the sharpener. However, wood, graphite, and rubber (in the eraser) are all combustible and create dust. Graphite, in particular, both burns and produces dust that conducts electricity.
The mechanical pencil has been used by NASA starting in the 1960s Gemini program. It can be made to be as wide as the width of astronauts' gloves, yet maintain its light weight. There are no wooden components which might catch fire and create dust. However, the pencil lead still creates graphite dust that conducts electricity.
Grease pencils on plastic slates were used by the Soviet space program as an early substitute for wood pencils. It is simple with no moving parts. The paper shroud is peeled back when needed. The disadvantage is that the paper wrapper has to be disposed of. Writing done with the grease pencil is also not as durable as ink on paper.
Ballpoint pens have been used by Soviet and then Russian space programs as a substitute for grease pencils as well as NASA and ESA. The pens are cheap, use paper (which is easily available), and writing done using pen is more permanent than that done with graphite pencils and grease pencils, which makes the ball point pen more suitable for log books and scientific note books. However, the ink is indelible, and depending on composition is subject to outgassing and temperature variations.
Felt-tip pens were used by NASA astronauts in the Apollo missions. However, wick-based instruments are designed around low viscosity, and thus operating temperature and pressure.