Does spacetime bending contradict the universe following euclidean geometry? According to experiments the universe is believed to be flat, meaning that it would follow euclidean geometry. However, is that compatible with the fact that spacetime bends due to gravity? Does euclidean geometry still work when spacetime bends?
I think I'm confusing static universe geometry and spacetime geometry, so I need some explanations. I have a pretty decent background on physics, but very bad general relativity knowledge.
 A: First, the universe is believed to be spatially flat (or close to it); that's not the same as spacetime being flat. The two-dimensional surface of the Earth is curved even though it's a part of a three-dimensional space that is flat (well, close to flat). In a similar way, it's geometrically possible for the three-dimensional surfaces that are called "space" in cosmology to be flat even though the four-dimensional spacetime is curved.
Second, the universe is only approximately spatially flat at very large scales. At small scales, you find all of the local curvature that you would expect from general relativity. This is similar to the Earth's surface appearing to be a perfect sphere (well, oblate spheroid) from a distance, but mountains becoming visible when you zoom in.
A: It looks like you’re mistake is in what a flat universe really means.
While the universe is generally believed to be flat as a large scale structure (meaning, flat in the same way a turbulent ocean looks flat if you zoom out enough) this does not suggest at all that that it behaves in a Euclidean geometric way. Spacetime by its definition is non-Euclidean; even a special relativistic treatment of spacetime shows that pretty quickly.
One indication of this early on in relativistic studies is that while two lines in, let’s say, a Minkowski-spacetime diagram look to be the same length, they are by no means the same length. This is seen in the Minkowski spacetime metric:
(The signs here may flip depending on who you ask)
$$ds^2=dt^2-dx^2-dy^2-dz^2$$
As you can see, this completely negates the Euclidean way of determining lengths that would dictate that all of the signs be positive.
