How do we know that universe is flat? Last measures by WMAP indicates that the universe is flat with a 0.04 margin of error. What does that exactly mean? Is it almost flat but with a soft curvature that could be negative or positive?
 A: We measure the (spatial) curvature parameter to be 0.000 with a 2 sigma accuracy (i.e., this with a 95% confidence) of 0.005, or 0.5%, according to the latest and most accurate satellite mission to determine the cosmological parameters. 
Note that of course our measurements are on the observable universe, with the horizon at a distance from us of about 48 billion light years. They can not take into account perturbations that happen at super-horizon sizes. It is still an amazing scientific success to be able to get this accurate even if only in our observable universe. If we add theory to the measurements, the flatness is due to a hyper-inflation that happened within (much less than) 1 sec after the universe started, and that would have made the inflated part of the universe have zero spatial curvature, or very close to it.   
How big that region was we just don't know, except that certainly bigger than the 48 billion light years radius we have. Beyond that it would not inflated, or perhaps inflated in certain regions and not others and formed a multi-bubble universe, or a so called multiverse. We just don't know, and this now becomes somewhat speculative. We might find out in a few billion years as our horizon expands, or through some other means we don't know now. But for the present and probably next few billion years that's all we care about. 
The measurement done for the spatial curvature is on the spatial curvature parameter $\Lambda_k$, which is measured at 0.000 plus or minus that 2 sigma error. The curvature parameter being zero means that the spatial slices of the universe have a flat geometry (i.e., zero spatial curvature). If slightly positive or negative the spatial slices would be slightly curved. The zero and accuracy numbers come from Eq. (50) in the Planck 2015 Collaboration results published in June 2016 in the arXiv paper at https://arxiv.org/pdf/1502.01589.pdf. Fig 26 shows the result in a graph where the red zone is the small region that the measurements and analysis constrain the results to be, 
The Planck satellite mission and analysis was the third generation mission to collect CMB (cosmic microwave background) data, after COBE and WMAP. It's more accurate data. They used purely the Planck data in the analysis, except they also used a set of data from BAO (baryon acoustic oscillations) measurements that are often used to resolve a well known geometric ambiguity in CMB-only data (the dashed line in Fig. 26), broken by the BAO (the red zone) and lensing reconstruction (the blue zone). The red zone, with some overlap with the blue zone, intersecting the dashed line is where you get the zero spatial curvature.
The next question is will we be able to get more accurate on the measurement, and thus maybe determine a very small positive or negative curvature? The analysis is that CMB measurements can be improved some, but if the curvature is less than about 0.0001 (i.e., 4 orders of magnitude separated from zero curvature) the CMB measurements won't be able to find it. 
So, what if indeed it is slightly curved, say around 0.001 curvature parameter? Well, the spatial slices would then be very slightly curved, and if the curvature is positive the universe would be closed, but because of the really small curvature it would still be huge, much bigger than the 48 billion light years in radius, and we would not see it close on itself (like a 3D sphere) because that pseudo-sphere would be so large we could not distinguish it from flat infinite spatial slice, within the 48 light years radius. If the curvature was negative and very small in magnitude again we would not notice it, it would be very large distances before we could see a curvature, the universe would be infinite and open. To get measurements for these cases we will have to measure other entities that we still don't know about. Gravitational radiation is opening up another window into the universe, and we will be able to 'see' back to much closer to the Big Bang, and perhaps carry out other measurements that could help us determine some parameters by which we could extrapolate better, but at this point it's just speculation. Higher energy particle physics will also teach us some new physics applicable to cosmology, but all of it will always be inside our past and future light cone.
A: To answer your first question, literature typically assumes a flat universe is infinite. (which is wrong) There are configurations of a flat universe like the torus that is finite. For the second question, Ω is measured to be 1.00±0.02, with 1.00 being a flat universe. So, there could be a slight curvature from a flat universe but this will only be confirmed by more accurate measurements
