The misleading part is the statement that you are removing "polluted water". The rate of removing this water is clearly constant. **But** your goal is to remove the **pollutant** , the stuff in the water, and its concentration goes down from the first moment.
Assume that at some time $t$ the tank contains $y$ pollutant. It could be grams of salt, ounces of ammonia or whatever. As you pump out a little of this polluted water in a short time $dt$, the amount of $y$ changes. Since the $y$ of pollutant is spread out over the whole 10 gallons, the concentration is $\frac{y}{10}$. You are removing 5 gallons of this polluted water per hour, so in a time $dt$ you remove a volume $5\times dt$. So the change in the amount of y, $dy$, is given by$$dy=-\frac{y}{10}\times 5 \times dt $$and the solution to this equations proceeds as above.