Fasting is typically done for some intention or purpose, yes.
If you are “offering it up” then that typically means you are giving the sacrifice to God in order to make reparation for the sins of yourself/ mankind in general. It can also mean you are offering it up for the Poor Souls in Purgatory.
You can either say a prayer before fasting, or just have the intention in your head; either way God will understand.
Also please remember that the Church requires fasting on only two days in the year - Ash Wednesday and Good Friday and that applies to people from age 18 to 59.
Any other fasting is voluntary and depending on what you choose to do you should make sure you are physically able to cope with fasting.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.