You have a few issues, first, you say that $T$ is infinite because it is contained in the set of all composite (non-prime) numbers. But this is the set you wanted to prove was infinite! What you really mean to say is that because there are infinitely many distinct prime numbers, the set $T$ is infinite. Because $T$ is contained in the set of composite numbers (every number in $T$ is divisible by $2$ and some prime, so the numbers in $T$ cannot be prime), then it must be that the set of composite numbers is infinite [so in a sense, you have proved what you wanted, modulo phrasing errors]. As for your last sentence, I think you mean how do you prove the set of primes is infinite, for that, see this answer.
But you do not need to invoke the infinitude of primes at all! Consider the set $T= \{ 2n \colon n \in \mathbb{N}, n>1\}$, i.e. the even numbers bigger than $2$. This set is clearly infinite because $\mathbb{N}$ is. Moreover, every number in $T$ is divisible by $2$ and some other integer, so every number in $T$ is composite. Therefore, $T$ is a subset of the composite numbers that is infinite, so that this set is infinite! You do not need to even consider this $T$; for example, $T= \{ 2^n \colon n >1\}$, $T= \{ 2 \cdot 3^b \colon n \geq 1\}$, etc all work as well!
Perhaps what you're worried about is that your (or even my) $T$ do not contain all composite numbers. But you do not need to find them all, just an infinite amount of them to prove that the set of all of them is infinite. Because the set of composite numbers (other than 1) is the complement of the set of prime numbers in $\mathbb{N}$, finding one set is the 'same' as finding the other. But finding all the primes is really hard! So it will be equally hard to find all the composite numbers. Again, luckily, this is not what is required for your proof.