"Would you walk at night from say the Gate Theatre to the Westbury hotel or to the Intercontinental (or is that too far to walk)?"
It's a fair walk from the Gate Theatre to the Westbury Hotel. You'd have to walk the full length of O'Connell Street, cross over O'Connell Bridge, walk up Westmoreland Street and then up (and by up I mean uphill) Grafton Street to the Westbury. I reckon it's at least a 20 minute walk. Maybe a little longer. I did it one night with my adult daughter. We went to a show at the Gate and then walked to our hotel which was near the top of Grafton Street. It was December and whilst the city centre was really busy generally, with Christmas parties and groups of tourists, O'Connell Street was practically deserted. Nothing untoward happened, but the lack of people made me very uneasy. It was only when I reached Westmoreland Street that I relaxed. O'Connell Street is Dublin's main street, but there aren't many attractions or shops along its length. During the day, it's busy, because of its proximity to Henry Street (busy shopping street). The G.P.O. (General Post Office) is on O'Connell Street, as is Eason's (bookshop/newsagents/stationery shop). But at night these are all closed.
It's 5 kms from the Gate Theatre to the Intercontinental.
Or please give me an example of a route safe to walk at night"
Generally speaking, Grafton Street is a very safe street. It's a busy shopping street (expensive shops though). The street winds it way uphill from Trinity College to St. Stephen's Green (urban park). During the day, there are buskers and entertainers on the street and they attract big crowds. I would feel very safe walking there at night. There are a lot of side streets off Grafton Street with bars, restaurants, coffee shops etc. It's a really nice part of the city. The Gaiety Theatre is just off Grafton Street, on South King Street.
Having said all of the above, there was an incident in this area at the weekend and a man was killed. Second man charged over fatal Dublin city centre stabbing. However, this isolated incident wouldn't stop me frequenting the area at night. This incident is very much the exception to the rule.
St. Stephen's Green is a popular spot for workers having lunch, especially on a sunny, summer's day. As a kid, I would have fed the ducks there. The Little Museum of Dublin is just across the street from the Green and the National Museum of Ireland is fairly close by. The Viking Splash Tours run from the Green also.
I would also feel safe walking up Dame Street and Lord Edward Street towards Christchurch Cathedral. I probably wouldn't go any further than Christchurch Cathedral at night. The Olympia Theatre is on Dame Street, so it's usually busy with people heading to/from the theatre. The pubs are busy enough there also.
I'd also feel quite safe walking along Georges Street. It's another busy spot at night.
"and areas to avoid?"
If you look at a map of Dublin city centre, you'll see that the river Liffey runs through the city. At night I would avoid the area north of the river. Aside from any safety concerns, there are more attractions on the south side. That's not to say that there are no attractions on the north side - I've already recommended the Hugh Lane Gallery. But the southside of the city is a lot busier and livelier at night.