O'Farrell was born on 17 September 1933, in Greymouth, New Zealand,[2] into an Irish Catholic family.
He was educated at the Marist Brothers High School, Greymouth, and at Canterbury University College, where he graduated Master of Arts with second-class honours in history in 1956.
[2][3] Having moved to Australia in 1956, O'Farrell earned a PhD from the Australian National University in 1960 on the development of Harry Holland, an early Labour Party leader in New Zealand, as a militant socialist.
[2] O'Farrell was appointed as a lecturer in history at the University of New South Wales in 1959, rising to become a professor in 1972.
O'Farrell's first research interests were in Labour history with the 1964 publication of a work on Harry Holland.