Mystery solved! The Military Archives in Cathal Brugha Barracks emailed me back, and cleared everything up!
Turns out my dad was wrong and it is not a photo of my grand uncle, Captain Patrick Mervyn.
Hugh in the archives said: 'I have checked the photo and it is actually a portrait of General Sean McMahon, the Chief of Staff of the Free State Army from August 1922 until March 1924. The writing at the bottom is his signature, so it is a nice photograph to have!
'The rank markings on the collar are a sign of a senior Staff Officer. Captain Mervyn would have had three bars specifically on his shoulder flashes.'
It turns out my grand uncle worked closely with Sean McMahon during his time in the army (1922-1926).
Patrick was Staff Officer in Chief of Staff’s Department, General Headquarters, and Personal Staff Officer to General Officer Commanding, Southern Command, Major General Sean McMahon.'
Hugh told me: 'Captain Mervyn would have been involved with clerical work in both Offices that he worked in. Major General McMahon was actually Chief of Staff (COS) during part of Capt Mervyn’s time in the Chief of Staff’s Office. General Richard Mulcahy was COS before that (he went on to be Commander in Chief after Collins’ death during the Civil War) and General Peadar McMahon was COS after that.
'Maj Gen McMahon asked for Capt Mervyn to be transferred down to him as his Personal Staff Officer (PSO) once he returned to Southern Command as General Officer Commanding (GOC), as the captain was familiar with the type of work involved.
'This work would have ranged from secretarial type work, to escort duty, liaison with various committees and Corps, and basically any work that the GOC might throw at him. The Captain who works here has had experience as a PSO to a Force Commander on one of the UN missions, and he says that he has never been so busy!'
Nice of him to go to the trouble. Thanks again to all who made suggestions. Would be interested to find out more about Sean McMahon.