She set off cheerfully on a picnic.

Literal

She [topic-は] energetically picnic [for-に] set-out-and went.

元気よく is a fixed compound adverb, distinct from 元気に. It runs on 元気 + よい ('good') in adverbial form (~く), giving 'with vigor, cheerfully, energetically' — a more emphatic, story-book flavor than the plain 元気に. 出かけて行く chains 出かける ('to set out, leave the house') with the auxiliary ~ていく ('go away from the speaker'), so the verb cluster reads 'set off and headed away.' に here is the purpose-に paired with a motion verb (ピクニックに出かける, 'set out FOR a picnic'), the same construction as 買い物に行く ('go shopping') and 散歩に行く ('go for a walk').