The mirror part of the compact that my friend gave me broke.

Literal

Friend [from-から] received compact [genitive-の] mirror [genitive-の] part [subject-が] broke [end-up-てしまいました].

A disappointed observation. 友人からもらった is a relative clause meaning 'that [I] received from a friend' — もらう ('receive') takes the giver with から or に. Here the relative clause modifies コンパクト ('compact,' the makeup compact). 割れる ('break, crack, shatter') is the intransitive counterpart of 割る ('break [something]') — used for things breaking on their own or without a specified agent, often with a note of regret. ~てしまいました ('ended up X-ing') adds the unwanted-completion nuance: 'broke, unfortunately.' The cumulative effect is 'I'm sorry to say it broke.'