It is unknown if there was curvature, but what inflation does is allow there to have been curvature, yet make it undetectable, hence making it consistent with observations. It is intended to deal with the "flatness problem", which is a form of "fine tuning problem"-- problems where the universe seems like it ought to have an arbitrary value of something, but instead it has a very specific and non-generic value of that parameter. It's not at all clear that fine tuning problems are real problems in science, but inflation does not only solve that one "problem", it helps with many others too, and some hold that it even makes predictions we had no reason to expect to be true that are borne out by the CMB. Perhaps the best way to frame that is that inflation unifies the solutions to these various "problems" under a single heading.