Removing the superfluous "at" leaves:
1A Before I went on holiday for a week, I was really eager to study mathematics.
This is grammatically correct, but ambiguous. It could mean that the spark was eager to study math before s/he went on holiday, but was somehow disenchanted during the week and no longer eager after it. Or it could mean that the speaker was eager to study during the holiday, or to study before the holiday started. Additional context would probably make the meaning clear.
The construction
2A To study mathematics, I was really eager
Is unusual, indeed unnatural. It sounds archaic or affected, because of the placement of the verb phrase "To study mathematics" before "I was really eager" (I would not call it wrong, but it will cause raised eyebrows every time.) The obvious revision is:
2B I was really eager to study mathematics before I went on holiday for a week.
This has much the same meaning as 1A, but emphasizes the desire to study, while 1A emphasizes the holiday. It also has the same ambiguity as 1A.
Some verbs naturally take "at" after the to-form, (or in the present) such as "play".
He seemed to play at mathematics, rather than to seriously study it.
Others do not, such as "study". Such forms as "work at" and "fail at" seem natural, while for example "feel at" does not.