Taking your own bike can be an inexpensive and flexible way to get around Catalunya, and is one of the best ways to take in Barcelona's far-flung sights. Despite the fact that the Spanish are keen cycling fans, they tend to see it more as sport than transport, and many pedestrians regard the city's new network of bike paths as additional pavements. There are bike shops in Barcelona and the larger towns, and parts can often be found at auto repair shops or garages - look for "Michelin" signs. Cars tend to hoot in warning before they pass, which can be alarming at first but is useful once you're used to it.
Getting your bike there should present few problems. Most airlines are happy to take them as ordinary baggage provided they come within your allowance (though crowded charter flights may be less obliging). Deflate the tyres to avoid explosions in the unpressurized hold. Spanish trains are also reasonably accessible, though bikes can only go on a train with a guard's van and must be registered - go to the Equipajes or Paquexpres desk at the station.