Boil the eggs: Place eggs in a saucepan, cover with cold water, and bring to a boil. Simmer for 10-12 minutes, then transfer to an ice bath for 5 minutes.
Peel the eggs: Gently peel eggs under running water and set aside.
Make the brine: In a saucepan, combine vinegar, water, sugar, salt, peppercorns, mustard seeds, bay leaves, garlic, and red pepper flakes (if using). Bring to a boil, stirring until sugar and salt dissolve. Cool slightly.
Pack the jars: Sterilize a quart-sized mason jar. Layer eggs, onion, and beet slices (if using) in the jar.
Add the brine: Pour warm brine over eggs, ensuring they’re submerged. Leave 1/2 inch headspace. Seal the jar.
Pickle: Refrigerate for at least 1 week, shaking occasionally for even flavor.