There are few ways to gain a feat temporarily. Moment of Clarity of the Void disciple for example.

As far RAW goes having the Extra Spell feat even for one round means your spellbook has a new spell.