A law clerk
works for a judge
, acting as that judge's lawyer
by doing research and drafting memorandums of law on the cases before him or her and advising the judge on how to reason and decide those cases
. Clerks often actually write the opinion
s that become law under the direction of the judge
Most law clerks are recent law school graduates, and a clerkship with a federal court (especially the Supreme Court) or a higher level state court is considered very prestigious. Most clerks serve for one or two years, though permanent positions do exist.
This is not to be confused with a court clerk, who manages the paper flow and docket of the court.