1. Are there implemented any special rules for gateways, or is this just something that everyone can do?
We call an entity a "gateway" if it has certain characteristics. If you have these characteristics, we'll call you a gateway. If you have some of them but not all of them, some people may call you a "gateway" and some may not. You can do whatever you want.
Generally, we call a company a "gateway" if:
1) They offer a reasonable "redeem on demand" agreement to a large group of people.
2) People have good reason to value their IOUs at close to face value.
3) They make it their business to issue IOUs.
But you can do most of what a gateway does without being a gateway. For example, you can sell Bitstamp IOUs to people face to face. You can buy Bitstamp IOUs from people face to face for cash.
2. Is BTC issued by A and B the same currency? As they may have different exchange rates, I think they are different. But it seems that when a payment goes through the system, they are treated as the same BTC, right? Or are users supposed to set exchange rates between various BTC? Probably they should; e.g. if I think that BTC issued by me are much safer than BTC issued by my friend, then as a payment goes through us, I would only agree to issue 0.9 BTC for receiving 1 BTC issued from him. What are the intentions about this?
In some cases they are treated as the same currency, in some cases they are treated differently. The system does allow you to value IOUs in the same currency but different issuers differently, but this is a very tricky feature to use correctly. The main difference is this: To change the issuer of an IOU but not the currency, you can ripple through someone. To change the currency, whether or not you change the issuer, you must take one or more offers.
3. What happens if there is a debt but no trust limit? I managed to buy some BTC but without extending a trust limit to the seller issuer first.
I think the scenario you're envisioning is this:
1) I deposit 10 BTC at a gateway using a Bitcoin transaction.
2) I don't extend trust to that gateway.
3) I try to withdraw the 10 BTC to my ripple account.
What happens depends on the gateway's policy. First, they can't give you their own IOUs since you don't accept them. And if you don't accept any BTC IOUs, the operation is impossible and will fail. But say you accept BTC IOUs from some other gateway. They could make the withdrawal work. There it's up to their policy. Possible policies are:
1) They just don't allow it. You must extend them credit to withdraw, period.
2) They allow it so long as it won't cost you more than 1%. So you may wind up with 9.9 BTC in your account.
3) They allow it at any loss level, provided you agree to accept the loss.
Also it appears that some orders could be created with similar results. Other way to get into this situation is possibly to remove the limit after the debt exists. Shouldn't this be restricted somehow? Or should it be not restricted and the trust limits would only be informative?
You can drop a credit limit below the level of IOUs you hold. This indicates you don't want to hold those IOUs any more. People can now take them from you but not give them to you. If you're an attractive path for them, they should fix it for you over time.
Actually why should I pressure friends about settling their debts at all? It may be something about that they can't pay me anymore, but hey, I could extend their trust limit further coz it's just a number?
If you extend them trust, you're allowing them to take IOUs you hold and to give others your IOUs! Unless you don't hold any valuable IOUs in that currency and don't care if other people hold your IOUs in that currency, this is *not* a good idea.