I've been told that Supposedly in the third century the roman empire experienced a lot of financial inflation because the successive Barrack emperors kept just coining new money everytime they needed to pay men.
Did they not know that would happen, ....or did they know and just not care?
It's not exactly inflation, but debasing the quality of coinage has a similar effect, and Romans did understand that. The reason to debase coinage is because you want to pass off the cheaper coin for the value of the more expensive coin. This periodically produced economic crises, such that people like Constantine had to re-establish a trusted coinage such as the solidus. Another option was fiat currency - the government simply declares the value of the coin regardless of its silver (or other precious metal) content, and that was sometimes tried. The most extreme example would be the edict of Diocletian, which set prices in terms of denarii regardless of metal content. Some ancient people were able to make this work; I think both the Ptolemies and the Attalids were able to run an economy on fiat currency (but I don't know too much about those). Republican Rome never seemed to make fiat currency work for whatever reason.
In addition to LegalAction's answer, the issue of inflation/deflation would not explicitly have been known (economic theory is a modern discipline), but there was a general understanding that inflation as they understood it was a very bad thing, and even in the ancient period a knowledge that a coin debasement was going to cause it eventually. However, they simply understood it as bad because it made things more expensive to purchase. You mention the 'Barracks' emperors; they knew this too, because inflation meant you had to pay more to keep your soldiers happy. And to boot, by the end of the third century, there were even more of those soldiers to pay.
To control this, the only known mechanisms were currency reform (expensive and difficult) and price controls (such as the Edict mentioned in LegalAction's answer) which were likely less effective. I don't know of any evidence that suggests they were aware of the negative aspects of deflation (or the positive aspects of inflation) though.