Generally, any expenses incurred that qualifies you for a new job are not tax deductible. Therefore, costs to obtain a commercial pilot certificate or the initial flight instructor certificate will not be deductible. However, there are ways to deduct flight training expenses.
If you are pursuing an aviation degree in college you will get a tax credit (up to a max of $2,000 per year) for costs associated with that degree--including flight training expenses.
If your job requires substantial travel and you can justify the costs of traveling in your personal aircraft, expenses to acquire your private pilot certificate and instrument rating can be deducted as a business expense. This will include costs to maintain proficiency (flight review, recurrent training, etc) and business use of your aircraft.
Once you obtain your commercial/flight instructor certificates, and are employed in the field of aviation, any reasonable expenses associated with maintaining and improving your skills can be deducted. For example, adding additional ratings (including type ratings), medicals, charts, uniforms not suitable for everyday use, etc.
Remember, when dealing with the IRS be prepared to substantiate everything you report on your return.