When properly set up a firewall will make your computer seem invisible to anyone randomly looking for computers to try and hack into. That means that if someone decided to scan a specific range of IP numbers the one that you are using would not be seen as active by the hacker. But it doesn't change your existing IP number. That number stays the same regardless of using firewall or not.
That's a completely different thing than changing your IP number when you actually send data out from your computer. The computers that you are communicating with while you surf or get email etc need to know your IP so the firewall allows that information to pass through. The firewall only stops the communications when you haven't instigated it or given it instructions to allow the data to pass through for some other reason.
Think of the firewall as an invisible door. When someone is randomly looking for a computer to hack into the door/firewall is shut and they'll ignore it. But when you want to use your computer to surf or email etc then the door is opened to those who you are communicating with because they now need to know you exist to send the data back to you.
They have your IP number because that's included in the data you send out. It's like putting a return address on an envelope you mail so the recipient knows where to return the mail to.
The firewall is necessary but more as a tool to stop random attacks from the outside and possibly to alert you to viruses attempting to secretly send data from your computer but it doesn't stop anyone you send data to from getting your IP address.
Do use a firewall but don't expect it to hide your IP adress in your email or while you surf. Tha's what a proxy does as I explained above.
