Although the Beit Yosef (OC 597) quotes the Kol Bo that some have the custom of fasting on Rosh HaShanah, most rishonim hold that fasting is inappropriate and that one should eat, drink, and rejoice on Rosh HaShanah, and the Shulchan Aruch paskens accordingly (with the caveat that the rejoicing should be tempered by reverence for the day). This accords with the pasuk quoted in Michoel's answer (Nechemyah, 8:10).
Because of those opinions that fasting is appropriate, the Shulchan Aruch writes (based on the Agur) that if someone fasts once, it is considered that he has accepted that practice and he must subsequently fast on every Rosh HaShanah. The Rema writes that he should get the custom annulled instead. Notably, R' Yosef Karo in Maggid Meisharim praises the custom of fasting on the first day of Rosh HaShanah (Siman 40). I have heard that this encouragement to fast was relegated to the Maggid Meisharim because R' Karo felt that fasting is only an appropriate approach for rare individuals.