The inflationary scenario proposes that during a brief period early in the history of the Universe, the scale size of the Universe expanded rapidly. If the inflationary epoch lasts long enough, the exponential function gets very large. Inflation, thus, solves the flatness problem rather neatly. Our horizon would be only a very small portion of the whole Universe. Just like a football field on the Earth's surface can appear flat, even though the Earth itself is certainly curved, the portion of the Universe we can see might appear flat, even though the Universe as a whole would not be.
Inflation also proposes a solution for the horizon problem.
If the rapid expansion occurs for a long enough period of time, two points in the Universe that were initially quite close together could wind up very far apart. If one was to take a heat-resistant, extremely flexible balloon filled with water and boil the water, the balloon would expand tremendously as the water changed to steam. In a similar fashion, astronomers and physicists have proposed various ways in which the cooling of the Universe could have led to a sudden, rapid expansion. It is worth noting that the inflationary scenario is not the same as the Big Bang. Thus, inflation assumes that the Big Bang theory is correct, but the Big Bang theory does not require inflation.