In saving the X-men or the world as they know it, I see it in many different ways Wolverine doing something very risky and it being successful.
But also what i had just thought of is what if (YOUNG) Charles Xaveir takes a huge step in this film knowing he can change the lives of everyone he knows so that they could live in peace. and what i mean by that is something like this..
In the last moments before taking down the baddie.. He could be using all his powers in one spot just going crazy add extremely sad and dramatic music and he knows by doing this not only would he save the world and the X-men but make sure that his friend Erik Lensherr would protect the world and live his life differently. And its the one and only thing he ask's of him.
In this scene Young Charles would die, and before dying look at (YOUNG) Erik Lensherr saying something like "I know you're better then you're past" or something very impacting to him, I'm not saying that's what he should say. And he would be saying that to Erik's Mind obviously because it would probably be hard to say in a moment like that, and to make even more dramatic Erik could be crying not want it to happen! haha. Add the awesome but typical "NO!!"
And why i think it would be good is the (OLDER) Erik and Charles could also have a moment before (YOUNG) Charles dies is they both know whats coming and they could have the same kind of moment too?!
Including the rest of the cast, Wolverine, Beast, Ice-Man and everyone else could be involved in that scene ( really dramatic for them too ) but just a special moment for Charles and Erik.
Then after that it could go through the years and time zones we have seen in the old movies and how different everything happened like Erik Lensherr helping kids and being the School for Gifted Mutants and just end it show Wolverine and the X-men above both of they're graves?.
Once again just a thought and how it could be a good closure and good to beginning! it would dramatically probably pull all audiences in!