Feste is Olivia's court jester. As is traditional, he is an exuberant and foolish character, often speaking in riddles and always wearing "motley" colored clothing. However, as is typical of Shakespeare, this "fool" is a character who provides insights into human nature. He is like the chorus of the old Greek plays who serves to illustrate themes and provide analysis for the main characters. He is intelligent and knows the people of his house well. He often makes sharp and biting comments about their behavior, categorizing them accurately if a bit harshly. Removed from the central conflict, he is able to be unbiased. Even though his comments can be considered rude, the characters don't think so. It is his job as jester to be witty and humorous, and that is how they take him. However, for the audience, he is a conscience that illuminates the motives and/or the inconsistencies of the characters.
A more complete analysis of this character is available by enotes. The link is below.