What does the 'ag' add to this sentence? Does it change the meaning in some way?
Peido is always followed by either â (before a consonant) and ag (before a vowel), it's just a part of the phrase.
Perhaps you can think of it as "refrain from drinking". If you just said "refrain drinking", that wouldn't make sense in English.
Why "I don't have to" is not accepted?
'Rhaid i fi beidio' = I must not (ie I am prohibited from doing)
'Does dim rhaid i fi' = I don't have to (There is no necessity for me to)
These are different sentences.
eg:- Rhaid i beidio ag yfed = I must not drink (It is necessary for me not to drink)
Does dim rhaid i fi yfed = I don't have to drink (There is no necessity for me to drink)
In spoken English we would not use refrain in this sense. Refrain is usually used in written English but not often in modern spoken English. The sentence stands as making sense - e.g. an ex-alcholic might say this when out with friends. Or if you were having an operation the next morning and it was late at night and you had been told not to drink (as has happened with me - only "sips" of water).