Your get the basic intuition, but real-life situation is a little bit different.
First, I didn't really understand what you meant by "try to catch some 'fool'", but what you are calling foreign exchange bank is actually called the Foreign Exchange (market), and consist of buyers and sellers that are basically ready to buy and sell any currencies (almost all currencies in fact) provided that the price is align with their expectations. Classic laws of market apply to this market, and if the government of country X (its central bank to be more precise) print a lot of money, it corresponds to an increase in the the supply. The result, as you might expect, is a decrease in the price of money relative to other money, which is the exchange rate.
Money may be hard to understand, but it is actually a right to future cash flow of a given country. It is a sort of perpetual debt with zero coupon issued by a given country. So, if the country issues more money, it means that it issues more debt, so as a dilution mechanism it yields less cash flow to each unit of money, and since the price of money (as the price of any debt) is the expectation of future cash flow, the price will decrease.
Then, this will indeed results in more inflation. I expose two ways of seeing that. First, you can think about the price of goods as the price of goods relative to the price of money. Indeed, you're going to pay $x$ for a particular good because the seller knows that it will receive $x$ and that $x$ will give him the right to a certain amount of GDP (cash flow of country). But if the amount of GDP that the money represents is lower, he will ask for a higher price. Second, traditional monetary research has derived, a long time ago, the following formula which represents what I explained in my first point, but more formally. The following is always true, it is an accounting relation :
M\cdot V = P\cdot Q
$M$ is the amount of money, $V$ is the speed of money, $P$ is the price level and $Q$ is the output or quantity of goods exchanged.
Without entering into too much details on this equation (there are extended information on Internet), you can see that increasing $M$, holding $V$ and $Q$ constant, results in inflation.
To come back to your question, country does not (only) print money to repay their debt, because they are afraid of inflation. There is a big debate on inflation (I'm sure you can read a lot of stuff on Internet also), but loosely speaking inflation seems hard to contain. So to avoid hyper-inflation situation, they try to maintain inflation (in general below 2%).
Your story does not need another company investing in country X because, as you said people will end-up with more money, but production of country X will effectively increase. But it is true that companies buy currencies for investment purpose in the country. Even local company may end-up buy their own currency if for instance they sell product in USA (exportations), and sell the USD they received against buying their own currency. This is why importation and exportation (worldwide) is a good indicator for fluctuations in exchange rates.
Printing money to pay debt is a complicated question, and I only tried to sketch up some insight here. For more information, read more on money creation and inflation (either in the academic literature or in economic textbook for instance).