The symptoms you have mentioned are typical for IBS
and colorectal cancer
That is why I strongly recommend you to have performed colonoscopy
The pain in your rectum
might be caused by hemorrhoids but this doesnt rule out other large intestine diseases.
And if its about IBS there is no way to diagnose it without ruling out all others gastrointestinal diseases.