In a large mixing bowl, combine the flour and salt.
Add the egg, warm water, and vegetable oil. Mix until a dough forms.
Transfer to a floured surface and knead for about 8 minutes until smooth and elastic.
Cover the dough with a cloth and let it rest for 20 minutes.
Meanwhile, boil the potatoes in salted water until tender, about 15 minutes.
Drain potatoes and mash until smooth. Let cool slightly.
In a skillet, melt the butter and sauté the chopped onion until golden brown.
Combine mashed potatoes, cheese, sour cream, and sautéed onions. Season with salt and pepper to taste.
Roll out the dough on a floured surface to about 1/8-inch (3 mm) thickness.
Cut circles about 3 inches (7.5 cm) in diameter using a cup or cutter.
Place a spoonful of filling in the center of each circle.
Fold dough over the filling to form a half-moon shape. Press edges firmly to seal, using a fork to crimp if desired.
Bring a large pot of salted water to a boil. Cook pierogi in batches for 3-4 minutes or until they float to the surface.
Remove with a slotted spoon and optionally fry in butter for a golden finish before serving.