In the US, we have a progressive income tax system in which taxes rates increase for dollars earned in higher tax brackets.
For this scenario, imagine there are 4 tax rates 5%, 10%, 15%, and 20%. The corresponding tax brackets are: 0-100K, 100K - 200K, 200K - 500K, and 500K+.
To calculate taxes paid, you simply need to calculate the taxes paid for dollars in each bracket.
(e.g. For income of 300K, 5%*100K + 10%*100K + 15%*100K).
Imagine you have a table of individual ids and their income. Calculate the taxes they owe on that income.