In the Bible, to fast means to go without all food and drink. Under the Law of Moses, the Israelites were to fast at the time of five of their feasts each year and at other individual occasions, such as grieving or as a sign of penitence. In Isaiah 58:3, it sounds as though the Israelites thought their prayers were more likely to be heard if they fasted. However, God said that what he really wanted was for them to abstain from wickedness and to show kindness to the needy.
There is no command for followers of Christ to fast, but it is not discouraged. When Jesus was asked why his disciples did not fast (Matthew 6:16-18) he spoke favourably about it, but he did not want it to be done for show. The only time when it is recorded that Jesus fasted was when he was tempted in the wilderness (Matthew 4:1-4), but that was probably not by deliberate choice but because there was no food there. Paul refers twice to his fasts (2 Corinthians 6:5, 11:27), but it is likely that these occasions were the result of a shortage of food.
In the KJV there are four places where fasting is advocated – Matthew 17:21, Mark 9:29, Acts 10:30, and 1 Corinthians 7:5 – but all these references to fasting are omitted in newer versions such as the ESV, because it is felt the words were later additions that were not present in the original New Testament. However their presence in the KJV probably indicates that fasting was well regarded in the early church.
So, the Bible does not discourage followers of Christ from fasting, nor does it say that fasting is compulsory for them.