The colour of the stools can be dependent on what foods he eats.
Having iron supplements can made the stools black as well as causing constipation.
Black stools can also be caused by bleeding.
If he has been straining this can cause a tear in the anal passage called a fissure as well as internal and external haemorrhoids. The doctor can prescribe suppositories as well as an ointment to help these heal.
I would definitely get him examined by the doctor. The doctor can prescribe medication to loosen his stools (not laxatives) to make it easier for him to go.
Make sure that he has plenty of water and diluted fruit juices to drink. Give him foods with roughage, like apples with their skins on (washed), oranges, prunes, all vegetables. Cut out or cut down on junk foods and sugary foods and drinks. If he likes porridge or RedyBrek give him those (if he is OK with these).
Best wishes.
Please ask the pediatrician about the process where the bowels can be emptied at the hospital, and especially whether or not that would be helpful.