If you spin a magnet in space, far from any magnet field, would it spin forever, being able to produce electricity forever? This is of course a purely theoretical question and it would take energy to get the magnet moving in the first place but once it's moving in the vacuum of space, with no gravity or magnetic field nearby, could it spin nearly forever (as in billions of years) producing a magnetic field from which you could get electricity?
If this wouldn't work, why not?
 A: 
But once it's moving in the vacuum of space, with no gravity or magnetic field nearby, could it spin nearly forever (aka billions of years) producing a magnetic field,

No.  A rotating magnet creates a changing magnetic field.  Similar to an oscillating electric field, it will radiate electromagnetic energy.  This energy will come from the rotational energy of the magnet.  The generation of this radiation will slow down the magnet.

for which you could get electricity from?

Only a finite amount.  Even if the rotation didn't radiate any energy spontaneously, any attempt to pull energy from the system would slow the magnet's rotation.  After extracting a finite amount of electricity, the magnet would stop spinning and there would be no more energy available.
A: A spinning magnetic dipole produces electromagnetic radiation.
The radiation carries both energy and angular momentum away from the dipole.
As a consequence the dipole will lose rotational kinetic energy.
Exactly this is thought to be responsible for the spin-down of pulsars.
A: For your question as to whether we could extract electricity from the spinning magnet for ever, the answer is no. Because by Lenz’s law which state’s 

The polarity of induced emf is such that it tends to produce a current which opposes the change in magnetic flux that produced it.

Therefore the spinning of the magnet wold be opposed due to the polarity of the magnetic field due the induced emf and hence the spinning would eventually come to stop.  The is energy dissipated by Joule heating produced by the induced current.
A: If there were solar panels to act as a back up supply to provide power to keep the magnet going despite the wear of radiation, then theoretically, yes
A: Depends on how you spin in.
Consider a cylindrical bar magnet.
If you spin it end over end (perpendicular to the axis of symmetry), then the dipole is changing and you will slowly radiate away energy and the spin will slow down.
If you spin it along the axis of symmetry, the dipole (or any higher moment) is not changing in time, so no energy will be radiated away.  However this will create an electric field.  It would cost you energy to start it spinning, but it doesn't cost any energy to continue "producing" the electric field.
Of course, if you try to use this electric field to accelerate charges and light a flourescent light or something, then of course, by conservation of energy, you would not be able to do this forever.
