In a mixing bowl, mix together the flour and salt. Add the egg, butter, water and combine. The dough will be quite clumpy at this stage. Transfer dough onto a floured surface and knead until no longer sticky. Wrap the dough in plastic wrap and refrigerate for at least 30 minutes.
In a skillet set to medium-high heat, add 2 tablespoons of oil. Add the onions; cook and stir until soft and transparent, about 5 minutes. Remove from the heat, and mix in the mashed potatoes, cheese and egg. Season with salt and pepper, then allow mixture to cool.
Divide the dough into 12 pieces. Roll each into a 5 inch round, 1/4 inch thick.
Place 2 tablespoons of filling in the center of each piece of dough. Gently fold the dough over, and pinch the edges of the pierogi, then twist and pinch until completely sealed. Place pierogis on a lined baking sheet, and bake for 25 minutes until golden brown.