In a large bowl, combine gluten-free flour and salt. Make a well in the center and add the egg and sour cream. Gradually mix in enough water to form a soft dough.
Turn the dough onto a floured surface and knead until smooth, about 3-5 minutes. Cover with a clean kitchen towel and let rest for 30 minutes.
Meanwhile, boil the potatoes until tender, about 15 minutes. Drain and mash with butter, then stir in the cheese and onion. Season with salt and pepper.
Roll out the dough on a floured surface to about 1/8 inch thickness. Cut out rounds using a 3-inch cookie cutter.
Place a small spoonful of the potato filling on one half of each dough round. Moisten the edges with water, fold over, and press to seal.
Bring a large pot of salted water to a boil. Cook pierogi in batches until they float to the top, about 3 minutes. Remove with a slotted spoon.
Serve the pierogi warm, or for a crispy texture, sauté them in a pan with a bit of butter until golden brown on each side.