I hope I’m getting what answer you are asking for.
First we need to determine what 5% of 49.99 is.
To do this we simply multiply .05 by 49.99.
Why .05 and not .5? Because .5 would be equal to .50 or 50%, which is a lot more than 5%.
This equals, 2.49. Now we first subtract the discount, then add tax. Because you would be subtracting 5% and then adding 5%, in effect they would cancel each other out and you would still be paying 49.99.
49.99 - 2.49 + 2.49 = 49.99
Hope this helps!