Matthew 6:16-18 KJV
16 Moreover when ye fast, be not, as the hypocrites, of a sad countenance: for they disfigure their faces, that they may appear unto men to fast. Verily I say unto you, They have their reward. 17 But thou, when thou fastest, anoint thine head, and wash thy face; 18 That thou appear not unto men to fast, but unto thy Father which is in secret: and thy Father, which seeth in secret, shall reward thee openly.
The purpose of fasting is to spend more time with God and to draw closer to Him.
You take the time you normally would spend eating (or doing an activity) and spend it in prayer. You would strive to hear what God is saying to you. If this is your true purpose (as it should be), then it wouldn't matter if anyone else could tell that you were fasting. If you are striving for others to give you recognition for participating in a "holy" act, then you aren't truly striving to draw closer to God. You will receive praise from men, but not from God.