Is this allowed: Roth -> Traditional -> Roth? And how to report gain?

In other words, is re-characterizing Roth IRA to Traditional IRA because of MAGI limit, and then later converting that Traditional IRA back to Roth IRA allowed?

 

And, is the gain taxable? For example, suppose I had $5000 in my Roth IRA, and then at the time of re-characterization, $5500 was transferred to Traditional IRA ($500 gain). And finally, $5500 was converted immediately to Roth IRA. Is the $500 taxable? And if so, how do I report this?

 

Many thanks!