Since how long is the pain?
Does the penis bend or kink when it is erected/hard?
Are you exposed to unprotected sex?
Do you have any urinary symptoms?
Are you diabetic?
Pain in penis on erection denotes prostate infection. It will need a course of antibiotics for the treatment. Your primary care physician can give you a prescription for it. Following measures are usually required to establish the diagnosis of prostate infection (prostatitis);
1) A digital rectal examination to see for the prostate tenderness.
2) A urine examination and a urine culture after prostate massage.
A referral to urologist may be sought for the above. Meanwhile do following as home measures;
a) Drink plenty of fluids; three liters a day.
b) Avoid caffeine and alcohol drinks.
c) Cranberry juice.
d) Avoid spicy food and chillies.
Please feel free for your follow up questions.
Colonoscopy does not see the prostate. It can only be felt be finger when the doctor palpate it by the digital rectal examination (DRE). You can try the measures, I had enumerated in the previous post. A mild infection can be flushed by the plenty of fluids. There is no emergency and you can give them a try for 2-3 days.
It is pleasure and privilege assisting you.
I hope this was helpful to you. If it was, please remember to ACCEPT the answer so I can get compensated for my work. if you have any more questions, please feel free to ask. I am truly privileged to help you, and I want to make sure that you are satisfied with the answer. Good luck!