You are confusing transactions fees, trading fees, and taxes
When you trade you pay the trading fees (to the website), no matter if you trade dollar for bitcoin or bitcoin for altcoins. When you withdraw your coins from an exchange or your wallet you pay the transactions fees (for miners)
You pay the taxes on the profits you make, buying at $1,000 and sell at $5,000 you pay based on the $4,000 profit (5000-1000)
The laws may vary from country to country so it's better you ask to someone in your country or to taxes office
That was very enlightening, thank you.