WASHINGTON—Several Supreme Court justices appeared reluctant Monday to overturn an Internal Revenue Service requirement that medical residents pay Social Security taxes.

Arguing before the court on behalf of the Mayo Clinic, lawyer Theodore B. Olson urged the court to reject the IRS rule as arbitrary. He argued that like other students, medical residents attend lectures, perform laboratory work and are focused primarily on learning.

Full-time...