Depends which copy is more useful/if they are identical.
I'm an English teacher, & it is better if students have the same edition as the rest of the class.
We usually supply class copies to be kept 'clean' (& used in open book exams) & students can then provide their own to annotate. If they end up with a different edition (eg. if it's a classic which a parent or older sibling hands down) then it can be a nuisance with page references being out of whack, or slight textual differences, especially with older texts.
I can also imagine scenarios with textbooks for Maths/Science whereby an older edition of the same text doesn't contain the most up to date material - exam specifications change all the time.
So if dd had older editions & dgm has bought her the newest, that's actually helpful to be fair - & I'd leave it to dd to keep dgm informed as to what she needs, if dgm is feeling generous.
If you've ended up with absolute duplicates of brand new texts, you have a choice: return yours & enjoy saving some money OR tell dgm you don't need hers, thanks, but can she check with you next time as it's a shame for her to waste her money?
I'd go with the first option tbh, in the interests of a quiet life & picking your battles. In future, take a backseat, get dd to confirm that she definitely needs a particular text & needs you to buy it for her, before you buy anything - it will be good practice for Uni anyway to get her into the habit of taking responsibility for her own texts, & aware of how much they cost.
I get it's irritating & pushes buttons that you know you shouldn't be letting her dgm press - my ex MIL was the absolute queen of upstaging Big Christmas & Birthday Presents with a bigger, shinier, noisier version of all my & xh's lovingly planned gifts. I used to grind my teeth over it until I learned to Let It Go...