Hi!
I don't know where you can buy a good bike in Dublin but I have visited Dublin last year and there are plenty of bicycleshops.
Cycling looks safe to me provided that you're used to cycle in big cities as the city centre is quite crowded, with especially around O'Connel street lots of busses and people crossing the streets. So be extra carefull there. As soon as you're outside the center cycling should not be a problem at all.
If you have some time try to cycle in the Wicklow Mountains, south of Dublin or along the coast. It's a beautiful area with (sometimes steep) lush green hills and nice views over the Irish Sea towards England.
Cycle the world (also in cities),
Whisky