Yes,it would be necessary to file tax returns in both states.
First, complete the Federal tax return. If your friend itemizes
deductions, the income taxes withheld (and thus paid) to
both States during 2012
are deductible on Schedule A of your Federal Form 1040 for 2012
(as well as taxes paid in 2012 for previous years, e.g. accompanying
the 2011 tax return filed during 2012).
On page 2 of Form 1040,
your friend will get the excess contributions for Social Security
tax as a credit (meaning it will reduce the Federal income tax owed
or increase the Federal tax return). The States of California and
Utah have nothing to do with this matter, even if the excess
withholding was done by the States as your friend's employers.
Next, your friend should complete a nonresident income tax
return for Utah. Many states compute state income tax for
nonresidents as follows.
Compute the state income tax $Z on the total income $X reported on
the Federal 1040 as per state rules for nonresidents. If $Y
is the income
attributable to the State, then the tax owed to the State is
($Z)*(Y/X). But, regardless of how Utah computes the
state income tax, this tax return needs to be completed
before the California tax return.
Finally, your friend needs to complete the California state
income tax return for residents. There will typically be a credit for
income taxes paid to Utah, though this credit might not be
the entire amount paid to Utah. That is, your friend will
be "taxed twice" on at least some part of the income.