(Assuming US based on "dollars")
In year one, you would get a $10 tax deduction based on the capital loss. So that would (all else being equal), offset the tax on the $10 gain in year two.
There is a limit to the deduction you can take in one year, although additional capital losses over the limit can be "carried forward" and be applied in future years to offset capital gains.
Also, taxes are only levied on realized gains. So for your scenario you'd have to sell the investment for $90 (realizing the $10 loss), then but it back (or something else) and sell it in year two to realize the $10 gain. If your investment just went down in value in year one and came back in year two, you'd have no net gain or loss and no tax.
That's a highly generalized answer. There can be differences based on many factors, such as tax bracket, short-term versus long-term gains, etc. But the gist is that the deduction on the loss offsets the tax on the gain.