Three days in Dublin are, in my opinion, almost the optimum to spend. You will see Ireland's capital, may explore many of the main attractions and even go a little bit further afield in County Dublin. The latter will give you a sense of place better than sticking to the centre can. It slightly depends on the weather, though - something not too important in Dublin itself.
On days 1 and 2 prepare to get up early, on day 3 ... it is up to you. And the evening before.
Day 1 - Morning to Midday
Start off in O'Connell Street and catching a Hop-On-Hop-Off Tour bus that will take you around Dublin, complete with commentary and good photo opportunities from the upper deck. Tickets for these tours are usually valid for 24 hours, making this a convenient mode of transport for today ...
Pass Trinity College with the tour bus, that will then head for the Georgian area of Dublin. You may want to get off here and explore the Government Buildings, Leinster House and the huge inner-city parks that are Merrion Square (Archbishop Ryan Park) and St. Stephen's Green. Afterwards, walk on to Kildare Street.
Here the National Museum of Ireland should not be missed (it is also a good spot for lunch). The minimum to visit are the exhibitions of the Celtic hoards, the early Christian treasures, the Viking settlements and the "Sacrifice and Kingship" section with its bog bodies.
Catch the next bus and let it take you past Dublin Castle to the Cathedral area - both Christ Church Cathedral and the Dublinia exhibition next door are worth a visit. Alternatively you may carry on by bus to the more rebellious bits.
Day 1 – Afternoon and Evening
Revolution in Dublin – the Easter Rising in 1916 will always stay in the Irish memory. The bus tour will take you past Kilmainham Gaol, where the rebellion's leaders were shot. I would, however, recommend heading straight on to the National Museum in Collins Barracks. Excellent exhibitions on both the military history of Ireland and the struggle for freedom will help you make (some) sense of it all. Also ... revive your flagging strength in the café.
In the evening, you may opt for a night out in an Irish pub. The less raucous alternative would be to take in a show, a concert or a play – Dublin can boast many venues that will provide quality entertainment. But do some research as soon as possible (use the internet from home, preferably) and book ahead. Late ticket sales are possible, though.
Day 2 – Morning and Midday
Again ... start early, but shun the bus and exercise your legs instead. Start the day at Trinity College, a leisurely tour can be done on your own. The Book of Kells and the Old Library usually sport a bit of a queue and involve some time waiting. Usually not that bad first thing in the morning, but decide for yourself.
As a follow-on or even an alternative, the Chester Beatty Library is highly recommended - just a few minutes up Dame Street and in the grounds of Dublin Castle. Again you can see Dublin Castle at your leisure or join a tour. Do not miss the treasures on display in the Chester Beatty Library. And for your lunch, both the café near the castle entrance and the Silk Road Café offer some good choices.
Day 2 – Afternoon and Evening
Fill your afternoon with a programme that suits your taste. You may like to spend some time shopping in Dublin. Or visit the National Gallery of Ireland to indulge yourself in art. If you have kids with you, you might dare to try the National Wax Museum Plus or the National Leprechaun Museum.
In the evening, why not hit the local brewery? A late (5 pm, or in summer even 7 pm) tour of the Guinness Storehouse will give you an insight into the history and importance of "the black stuff", earn you a free pint and maybe a sunset viewed from the Gravity Bar. An alternative would be to head straight for the Temple Bar area and the pub trail.
Day 3 – Morning and Midday
Today, go straight to one of the main railway stations on the DART (Connolly and Pearse Station are the most central), buy a day ticket and then head south. If you take a train to Greystones, you might walk back along the cliffs to Bray and then rejoin the train towards Dun Laoghaire. If you are late (or your feet are hurting), skip this part and exit the train at Dun Laoghaire.
With its harbour, its almost Mediterranean feel in some places (and in the right weather) and the National Maritime Museum, Dun Laoghaire is a good place to go exploring on foot for an hour or three ... the latter time frame will also allow a visit to the James Joyce Tower and the 40 Foot Bathing Place (nude men included).
Then grab a snack for your midday meal and head back to the DART station, taking the next train heading for Howth.
Day 3 – Afternoon and Evening
You will now travel all around Dublin Bay on the train, with some great views (and a few unusual ones, like going under the Aviva Stadium at Lansdowne Road). Provided no oncoming train obscures it, you will also have the best view of Custom House.
When you arrive at Howth, you may opt for the energy-intensive cliff walk or the bracing but less strenuous stroll on the piers, both are nice, relaxing and have good views. Choose according to fitness and daylight time left.
And then ... well, Howth has a large number of restaurants, cafés and takeaways, so your evening meal will be sorted. Maybe at King Sitric, one of Dublin's finest eateries? Or with a traditional takeaway, strolling along the pier, avoiding the seagulls and watching the seals? Watch the sun go down, from the pier or from the terrace of a pub ... then head back on the DART into Dublin.