How does inflation affect the economy?

Inflation increases prices and decreases the purchasing power of money. The impact of inflation depends on its level of magnitude and how healthy economic growth is.
High inflation hits poor; and low-income households as their purchasing power diminish, especially if the rise in inflation is not accompanied by substantial wage growth.
Large fluctuations in the inflation rate hurt price stability, which raises uncertainty in business transactions, investment, and confidence in the currency and the system.

Inflation eats savings and debt.

Supposing that someone deposited his funds at the bank aiming for a 5% annual return and the inflation rate is 2%. The real returns diminish by the impact of inflation and become only 3%, as the purchasing power of the deposited amount of money has been decreased by 2%.
Inflation eats debt also, as the amount of money borrowed loses value over time, and the real interest rate paid to the lender equals the nominal interest rate minus inflation.
Borrowed money at 5% nominal annual interest rate will be paid back at 3% real interest rate supposed that inflation rate is at 2%.
100$ borrowed would be paid back by 105$, but due to a rise in inflation by 2$, 105$ would only buy what 103$ could buy one year before.
Theoretically, inflation eats both debt and savings. It benefits debtors as they borrow more and pay less in value. However, nominal interest rates often tend to rise in those circumstances to cover the effect of inflation.

Positive impact of inflation:

Stable Inflation, at a reasonable rate, may have some positive impact, as it stimulates economic growth, especially when it is driven by an increase in demand and, to some extent, by more money supply.

Increase in money supply: 

Higher rates of money supply increase the availability of cheap money in the market. That may push many firms to expand their businesses and hence have a positive impact on economic growth.

Increase in demand:

Demand-driven inflation usually encourages companies to produce more and make large investments as they see their profit margins grow, which increases employment and growth.
High inflation hurts the economy, as well as low inflation. A reasonable inflation rate of increase depends on each country and its historical experience with inflation.
Generally, as central banks are mandated to maintain price stability in the system they set what is likely to be an optimal inflation rate within a target range. In most developed countries, a reasonable annual inflation rate is aimed to be sustainably around 2%.

Negative impact of inflation:

High inflation deteriorates the standard of living because it reduces the real income value. With the same salary, people will buy less quantity of goods and services than a year before.
It decreases the real interest rate; (nominal rate of interest minus inflation rate), which reduces real returns on savings.
This situation drives households to save less, as they expect purchasing power of their money to deteriorate over time.
In theory, savings are the main source of funds for investment. Banks play the intermediary role; in a way that they take money in form of saving deposits and lend it to investors.
Less savings push the country to borrow from abroad and, therefore, a deficit in its current account balance.
High inflation rises the degree of social class inequality, as it affects low-income households more than those of high income. Poor and low-wage people have a higher utility of money, and rising prices of essential goods and services make their life harder.
In addition, differences in spending patterns across households and differences in price increases across goods and services lead to unequal levels of inflation for different households. (Inflation Inequality in the United States)