If I purchased a stock for $100 and sold it for $200 in the same calendar year, my capital gain is $100 minus fees.

This “$100 minus fees” is my income, right? What if I buy shares at the same company for the “$100 minus fees” amount. Am I reducing my income for tax purposes?
Thank you

Incoming search terms for the article:

exchange gains from stock into home, if you sell a stock and immediately purchase another one do you still pay capital gains taxes, reinvesting short term capital gains in small business