Pat,
His service record does not appear to have survived. Does his South Africa medal have his number on it? I think you are right to assume that he enlisted in early 1898, which means that either he lied about his age (he would only have been 16 in January 1898) or he joined as a boy soldier and was not supposed to deploy overseas until he was 18 ie after April 1899. Logically he would have joined the 1st battalion as they were in Fermoy at the time (the 2nd Battalion was in India). The 1st Battalion left Southampton for Cape town in August 1899 (when he would have been old enough to go with them) and arrived in Cape Town on 16 September. After distinguished service in the Second Boer War, the 1st Battalion left from Capetown in September 1902 and sailed to Bombay where they were stationed until December 1914. We know that he landed in France with the 2nd battalion on 14 Aug 1914, so at some point he must have transferred between the two regular battalions. Alternatively he joined the Reserve following the end of the Boer war and was recalled to the colours in the Summer of 1914, which is when he joined the 2nd Battalion. I don't think was initially with the 2nd Battalion after enlistment because of the age issue.
The 2nd battalion transferred from India to South Africa in November 1901 and were employed on blockhouse garrison duties, the fighting in the Orange River area having subsided somewhat.
There are only 3 J O'Briens shown in the R Mun F Boer War medal rolls:
O'Brien J 2nd Battalion
O'Brien J 2536 Private Severely wounded. Bethlehem, 6 July 1900 1st Battalion.
Source: South African Field Force Casualty Roll
O'Brien J 6326 Private Severely wounded. Kroonstad, 24 September 1901 1st Battalion. Accident
Source: South African Field Force Casualty Roll
so possibly the first one (with no number or rank shown) is your grandfather, which indicates that at the point when the medal rolls were compiled he was with the 2nd Battalion.
Another possibility is that he didn't join the Regular Army in 1898. Instead he enrolled in the Militia and so went to South Africa after the 3rd (Militia) Battalion were embodied at Kinsale on 5 December 1899, and then arriving in Cape Town on 19 March 1900. The 3rd (Militia) Battalion returned to Cork and were disembodied on 31 March 1902. If this was the case, then he may have initially had a different number (the militia usually used a separate set of numbers to the Regular battalions) hence my earlier question about his SA medal. But this version of events doesn't account for him being 5580 at the start of the First World War. So on balance I'm inclined to discard the Militia theory.
Further information on the R Mun F in South Africa:
https://www.angloboerwar.com/unit-information/imperial-units/574-royal-munster-fusiliersAs for his First World War experience, you probably know all there is to know about that. He deployed with the 2nd battalion and on 27 August 1914, his first day in action, he was captured by the Germans and spent the rest of the war as a POW. He was discharged on 26 Sep 1919.
Usually I suggest contacting a Regiment's museum or Association to see if they have more documentation such as enlistment books, but it appears that the Royal Munsters don't have a dedicated museum, and their Association website lacks any
research contact details. The next best thing might be to try the Cork City Museum:
https://www.corkcity.ie/en/cork-public-museum/exhibitions/past-present-exhibitions/the-forgotten-regiment-the-royal-munster-fusiliers/