A way to show our response to an external stimulus whether good or bad. Probably also a way to let our body know it will be called into action.
I suspect they also arose before we had language so others would know your state of mind in an easy to understand way.
Hi Scientest! A very important question to understand what makes us humans so interesting! Like Michael said, emotions are a good way to communicate to others what is happening to us, so they can learn from us. We are very social animals so expressing complex situations by arousing feelings is the best way to get some ideas across.
The areas of the brain that are important in processing and producing emotion are found in a part called the limbic system. One structure called the amygdala is particularly important for generating our feelings (such as changes in heart rate, by activating other structures which control the body) and learning what actions caused us to feel what emotions. If we damage the amygdala of mice, they will no longer learn to fear an electric shock and get out of danger for example.
So even animals have similar systems for simple emotions, but in humans we have complicated environments, and the triggers for and way we express our feelings have become even more complicated.