How to know if blackberries are safe to eat?
As soon as you get them home, inspect for damaged berries &amp; discard any that are not perfect. Wash the rest in a colander or sieve under cold running water. Drain well.

Spread on dry paper towel for 30 mins to fully drain &amp; dry, then put them in a new box with paper towel under &amp; over - don't seal them with a snap lid.

Place in the fridge, in the salad crisper if you have one.

Life-span should now be more like a week.

The rapid spread of mould is from possibly just one single damaged berry. If they are touching &amp; sweating, that can spread like wildfire. If they are clean, dry &amp; cold, in air that can circulate around them, then you should be fine.
You could possibly be OK eating ones from the opposite side of the original punnet, but I wouldn't really. Safe rather than sorry, so do the preventative work first.

If it happens again even after you took proper care, pick a new store, or complain at the first one - though bear in mind that even with care, they are still fragile &amp; won't last forever. Your sign of end-of-life when clean &amp; dry should be shrinkage, they will eventually start to dry out &amp; look wrinkled, rather than mould.

From comments under the OP [1] - it's possible that the mould spores are in the fridge not in the berries. The berries, if damaged in any way, simply provide a suitable breeding ground.
I'd recommend a fridge-sanitisation day. My method will prevent fast cross-contamination, but won't kill existing spores.

[1] "It's very strange since this problem started only in the last 2 months. I don't know if the grocery store is continuously selling moldy berries or not"