Does the expansion of the universe affect its shape? This may be a very simple question, yet I cannot find an answer that satisfies me. I have read (and please correct me if I am wrong) that the shape of the universe depends on its density. If it has too much matter it would be a sphere, and the sum of the angles inside a triangle would be more than 180º; if it has a small amount of matter it would be like a saddle, and the sum of the angles inside a triangle would be less than 180º. Yet it looks like it has just enough to be flat.
So this is my question: if the universe is expanding, does that not mean that its density gets lower? And if it does, does that means its shape will change?
I have been doing some thinking and this is the conclusion I reached this far: Considering the amount of dark energy increases together with the universe, then the total density would not change. In case this is wrong (and I think it is), I would appreciate if someone could explain to me why.
Sorry for the long question, and thank you for your attention.
 A: If by shape of the universe you mean it's curvature, that is open, closed or flat, the answer is no, or very very little. If the universe is flat today it always was (at least back to the end of inflation) and always will be (forever). That would be true according to the $Lambda CDM$ standard model of the universe. 
If it is slightly different from flat (the total density parameter slightly different than 1, which would make it exactly flat), it would remain very close to 1. See my answer for Does the density parameter change over time?
Note it was derived in an earlier post by @Pulsar and in my answer I refer to it so you can see the derivations 
If the current curvature was much different than flat then yes, there is an evolution equation that shows the change. You can see that also in the reference. 
If by the shape of the universe you mean it's topology, Einstein's equations do not say anything about that, and topologies could be (as we have seen so far, but we've not seen the whole universe, not all the details or ours) Euclidian, or various others eg a donut shape) if the topology is NOT simply connected. For that, and whether it is finite or infinite (we don't know, but if Euclidian topology and simply connected, and flat, it'd be infinite; it slightly closed it could very very large, but finite. See the Wikipedia article at https://en.m.wikipedia.org/wiki/Shape_of_the_universe
I 
