Both of our IRAs are with Vanguard invested 100% VTSAX, if it matters. I realize that in order to a backdoor Roth IRA we would contribute $5500 into a traditional IRA and then convert it to Roth the next day (and that is what we would do next year if our income exceeds the limits) but what do you do if the money has already been invested as Roth since the beginning of the year, has had substantial gains, is all mixed in with your older/legal Roth monies, and may become illegal by year end? What fees/taxes might be involved in that process and how messy/time consuming is it? Thank youuuuuuuu.
Relax, you're going to be OK.
As a previous poster points out, the limits are related to your AGI, not your overall income, so you may not need to do anything.
If you do happen to exceed the limits for contributing to a Roth, you have two choices:
1. Withdraw your Roth contributions before you file taxes next year. You will owe taxes on any earnings attributable to your contributions (because the contribution was not allowed, the earnings are not tax-deferred) and possibly a 10% penalty on the earnings portion (because it turns out not to be a qualified withdrawal).
2. Recharacterize your Roth contributions, along with any earnings attributable thereto, into a traditional IRA. If you do this, there will be no taxes and there will be no 10% penalty. If you already have a traditional IRA that contains deductible contributions, I would recommend a second, non-deductible traditional IRA so you can keep track of things more easily, although that's not strictly necessary from an IRS point of view.
In either case, Vanguard will not charge you any fees to do this. They also will automagically include any earnings (or losses) attributable to your contributions. Just give them a call in the spring and explain what happened; they handle these kinds of things all the time. They will probably have you fill out a form and mail it in.
Finally, you may end up in a phase-out range in AGI where a Roth contribution is permitted but limited. If so, all of the above still applies with the additional comment that you are permitted to do partial recharacterizations. So maybe you contributed $5500 to your Roth IRA and were only permitted to contribute $3000; you can then recharacterize $2500 of your contribution into a non-deductible traditional IRA.
Good luck!