James Mercer was educated in Liverpool, attending University College there before entering Trinity College Cambridge to study the mathematical Tripos. Among his contemporaries there were G N Watson and J E Littlewood while he was taught by Whitehead, Whittaker and Hardy. Hardy had just come onto the staff at Trinity and he acted as a private tutor to Mercer. In  Littlewood describes the Mathematical Tripos examinations which he and Mercer sat. Describing Part I of the Tripos, Littlewood writes:-
[The examination] consisted of 7 papers ('first four days') on comparatively elementary subjects, the riders, however, being quite stiff, followed a week later by another 7 ('second four days'). A pass on the first four days qualified for a degree, but the second four days carried double the marks, and since it was impossible to revise everything the leading candidates concentrated on the second four days ... On the problem paper [for the first four days] Mercer got 270 out of 760 for 18 questions (I got only 180). ... In the second four days (ignoring the problem paper) Mercer and I each got about 2050 out of 4500 (each about 330 out of 1340 in the 18 question problem paper).Mercer graduated in 1907 bracketed Senior Wrangler (first equal) with Littlewood. He was awarded a Smith's prize and, in 1909, he was elected a Fellow of Trinity. He returned to his home town of Liverpool for a while, being appointed as an Assistant Lecturer there, but soon after, when the opportunity came to return to Cambridge, he accepted a Fellowship and Lectureship in Christ's College.
During the First World War Mercer served as a Naval Instructor. He saw active service at the Battle of Jutland, the only major encounter between the British and German fleets during the First World War. Fought off the coast of Denmark, it began on 31 May 1916. The battle was inconclusive but the British fleet suffered heavy losses. Mercer survived the battle and at the end of the war returned to his duties at Cambridge.
Back in Cambridge he resumed his mathematical research, continuing his work on function theory. He was elected a Fellow of the Royal Society in 1922 but after this time his health, which had been poor for some time, began to fail. He took ill health retirement in 1926.
Hobson  gives this overview of Mercer's mathematical achievements:-
Mercer was a mathematical analyst of originality and skill; he made noteworthy advances in the theory of integral equations, and especially in the theory of the expansion of arbitrary functions in series of orthogonal functions. His output of original work would no doubt have been much larger had he not been continually hampered by bad health.Mercer's theorem about the uniform convergence of eigenfunction expansions for kernels of operators appears in his 1909 paper Functions of positive and negative types and their connection with the theory of integral equations published in the Philosophical Transactions. There have been many papers written since then generalising Mercer's theorem to various other settings. For example Mathematical Reviews contains at least 65 papers studying such generalisations which have been published since 1980.
Article by: J J O'Connor and E F Robertson