When buying blue potatoes how can you tell what color the flesh will be?
It's almost impossible to tell without studying all the different types of blue/purple potatoes and memorizing slight differences in size and hue. One trick is that the potatoes with the deepest, darkest blue skin typically have purple flesh. And the lighter ones are more likely to have flesh that's yellow or even white.

Sometimes, the potato will have a sign with the exact name of their variety:

Examples:


Royal Blue Potato - Light blue skin, yellow flesh; typically large and oval-shaped
Andirondack Blue Potato - deep blue/purple skin, light purple flesh 
All-Blue Potato -
deep blue skin and flesh


(I suggest doing a Google Image search on these varieties to learn the difference)

One interesting fact: the Andirondack Blue Potato is a hybrid developed by Cornell University, which is how it got its purple flesh. I'm not sure if purple-fleshed potatoes exist in nature.