Preheat oven to 350°F. Grease a 13x9-inch baking dish.
Put sweet potatoes into a pot, cover with water, and bring to a boil. Reduce heat and simmer for 20 minutes, or until potatoes are fork-tender. Drain, then add butter, salt, and pepper. Mash sweet potatoes and set aside.
In a skillet over medium heat, break up sausage and cook until no pink remains. Drain, reserving 2 tablespoons of fat. Transfer sausage to a bowl. Return skillet to heat; add reserved fat, mushrooms, and onion; and cook until onions are soft. Add mushrooms and onions to the sausage.
In prepared baking dish, layer half of sweet potato mixture, half of sausage, and all apple slices. Repeat, ending with sausage. Bake uncovered for 35 minutes. Sprinkle with cheese and bake for 10 minutes more.