A ghost from Brazil’s past is again haunting Latin America’s largest economy: Inflation is crimping family finances, curbing business investment and clouding the future.

On Friday, Brazil reported that inflation had reached 9.56% for the past 12 months through July, a level not seen since 2003. Basics such as food and utilities are driving much of the increase. Electricity has risen 57% over the 12-month period. Meat rose 20%.

The hefty increases are forcing households to reduce spending, hurting businesses, fueling unemployment and exacerbating an economic contraction that is likely to reach 2% this year.

Elisonete Rodrigues, a 47-year-old physical therapist, is feeling the pinch as her clients tighten their belts and her own costs rise.

“I’ve lost six clients since June,” she said while calculating the cash flow at her empty Pilates gym in a Brasília suburb on a recent afternoon. “I am working only to pay the rent, and if it goes up I will have to shut down.”

All this despite a benchmark interest rate of 14.25%, one of the highest in the world. Brazil’s central bank has raised the Selic 16 times in the past two years in failed attempt to wrestle prices closer to the government’s official 4.5% target.

But the consequences of past economic mayhem, including hyperinflation in the late 1980s and early 1990s, continue to dog Brazil. Economists say that around seven decades of strong price increases have created habits that feed inflation in a vicious cycle that is hard to break.

Chief among them is indexation, or raising prices based on past inflation. It started in the 1960s, when inflation was 90% a year. The government pegged its bond yields to price indexes, effectively incorporating inflation into public finances.

Soon all sorts of prices, from salaries to rent to bank loans and more, were linked to inflation. Some still are, and Brazilians have grown used to it.

“The country has a memory of inflation, a culture of indexation,” says Armando Castellar, from the Ibre think tank in Rio de Janeiro. “In the U.S. or Europe people know for sure that the central bank will keep inflation low. Here they don’t,” he said.

As a result, workers continually press salary demands and businesses try to raise prices to stay a step ahead of inflation, a protective strategy that keeps inflation alive, Mr. Castellar said.

Inflation indexing is a big driver of Brazil’s troubled social security system, which already pays out more in benefits than it takes in through worker contributions. The shortfall is covered with money from other taxes, a bill that is projected to amount to 89 billion reais (about $25 billion) this year.

This gap is a major reason that Brazil’s government is having trouble balancing its books. Indexing imposes relentless cost increases that force the government to borrow more. Brazil has seen its debt jump to 63% of gross domestic product from its historic low of 51.8% in December 2011.

That might seem conservative compared with countries such as the U.S. and Japan, where the public debt is higher than GDP. But their governments borrow at rates close to 0%, while Brazil is currently paying 14.25%.

Brazilian Finance Minister Joaquim Levy is trying to balance the budget by reining in spending, a policy that is facing a strong backlash in Congress. He recently had to backtrack on aggressive 2015 fiscal targets, increasing the risks that Brazil could lose its investment-grade status.

Markets have responded to the uncertainty by punishing Brazil’s currency, the real, which is now valued at 3.50 to the dollar, versus 2.25 a year ago. The slide has increased the price of imports, still another driver of inflation.

State price controls have also hurt. In the past few years, the government subsidized electricity rates to help fight inflation. But when that grew too costly, the government was forced to let electricity rates rise at a breakneck speed this year. Power bills for many Brazilians have doubled.

Mother Nature has also played a role in fueling recent inflation. A prolonged drought has forced electricity producers to switch from low-cost hydroelectric power to more expensive fossil fuels. Dry weather has pushed up food prices too.

The mix of government meddling, dry weather and déjà vu helps explain why Ms. Rodrigues, the physical therapist, sees no end to it in the short term.

“I think we will have to endure this crisis for at least three more years,” she said.