I use a Sharpie. I've read those posts where people say you shouldn't do that, but you can find a reason to not use anything if you look enough, whatever you use could be bad. I do not accept that the vapors created when the Sharpie liquid dries will penetrate the shell, the membrane around the egg, and all the way through the whites to the embryo on the yolk when it's so much easier for those vapors to just go away in the air. I've had great hatches using a Sharpie.
When I was a kid on the farm it was my chore to mark the eggs that went under a broody hen. This was before Sharpies. I'd usually use a pencil. Not a hard light pencil, a soft-leaded pencil sideways to make a broad dark band. Those lasted well enough under a broody hen. We used to use a numerical scale to measure how soft the pencil was and how dark of a line it left. A #1 was dark and the one I'd use. Most people use an H or B scale now for pencil hardness, especially artists. Use a soft dark one.
We did not have ball point pens way back then, if we had to write in ink we used a fountain pen. Yeah, I'm old. A few times I used ink to mark the eggs.
This was all under a broody hen where she was constantly rubbing the eggs with her feathers. This was long before we had the internet to tell us that no matter what we do there is something wrong with it.
I was not trying to write something on the eggs I needed to read, just mark them so I'd know which belonged. A soft leaded pencil worked fine for that. Now I write numbers on the eggs that go in the incubator so I can tell which one was laid first (that helps to check on some of the comments about how things like that affect hatching) plus I can better keep track of individual eggs and how long ago they pipped. If the eggs go under a broody hen I just make stripes with a Sharpie so I can tell at a glance that it belongs.