Do you need to pay the carrier after jailbreaking iphone 4 or 3GS?

No you don't because if you told the carrier your phone you jail broke your phone it could get bricked. Bricked means its deactivated and you can't use it anymore. Technically jailbreaking you phone is legal but if you buy any free apps with it then they brick you phone if they find out.