I have ongoing pains sometimes on one side of my brain or both and I just wanted to know the cause of this?

Difficult. Headache requires extensive history, examination and testing. It is not that straight forward.
Brain pain. Pain in the region of the head and face has many, many potential causes. Many are common, some are more rare. Some are potentially dangerous. Regardless, any persistent pain should be evaluated in person by a qualified physician and this cannot safely be evaluated on the internet. See your family physician!