One of the 39 prohibited Melachot of Shabbat is HaShohet-slaughtering. One of its Toladot (corollaries) is Netilat Neshama (taking life),which also includes causing bleeding to people or animals. Even bruising someone is a violation of this prohibition. The "black and blue mark" is an indication that blood vessels were ruptured. Therefore, one should be careful not to pinch someone, even in jest, so as not to cause such a bruise. The Ben Ish Hai (Vayera 12) brings this, and says that it is prohibited M’Drabanan (rabbinically).
The Poskim discuss whether it is permitted to use a toothpick or dental floss to clean one’s teeth on Shabbat. Does the fact that he may bleed make this a prohibited action? Hacham Ovadia (Halihot Olam Vol. 4) quotes the Ben Ish Hai who is strict and prohibits it. However, Hacham Ovadia himself is lenient. He argues that since one has no use for the blood, it is considered a Melacha She’enah Sriha L’gufa-an action not needed for its own sake. That fact, coupled with the fact that the Melacha here is only M’Drabanan in the first place, will make it permitted in situations of Sa’ar (pain), like this where this is discomfort or pain of having food caught in between the teeth.
Similarly, Hacham Ovadia (Yabia Omer Vol. 4 OC:30) also discusses whether it is prohibited to use a toothbrush on Shabbat out of concern that it will cause oral bleeding. There also, he rules that it is permitted as long as it is not certain that it will cause bleeding.
Interestingly, according to Rambam, if someone bruises someone else in order to assuage his anger, it is considered an Issur D’oraita, because his goal was accomplished. On the other hand, the Ramban considers that case also to be a Melacha She’enah Sriha L’gufa and only prohibited by the Hachamim.
It is permitted to use a toothpick, dental floss or toothbrush on Shabbat, as long as it will not cause certain bleeding.