This is a genuine quote from the Buddhist scriptures. It’s from the Sutta Nipata.
“See them, floundering in their sense of mine, like fish in the puddles of a dried-up stream — and, seeing this, live with no mine, not forming attachment to experiences.”
—The Buddha
This is a saying from the Pali canon, upadhi dukkhassa mūlanti, which means “Attachment is the root of suffering.” So this is a genuine canonical quote.
You’ll find it in this sutta, but translated by Thanissaro as “Acquisition is the root of stress.” His translations are rather idiosyncratic.
In this translation of the same sutta it’s “acquisition is the root of suffering.”
Bhikkhu Bodhi’s translation (not available online, but in The Middle Length Discourses of the Buddha, page 868) has “attachment is the root of suffering,” although he sometimes has “acquisition” in place of “attachment,” in various repetitions of the phrase.
“Those attached to the notion ‘I am’ and to views
Roam the world offending people.”
The translator notes that “I am” is not in the quotation, but that its inclusion is warranted by material nearby.
The original Pali is:
Saññaca diṭṭhiñca ye aggahesuṃ
Te ghaṭṭayantā vicaranti loketi.
My rendition would be:
Those who cling to perceptions (saññā) and views (diṭṭhi)
Wander (vicarati) the world offending (ghaṭṭeti) people.
[Added later: Bhikkhu Varado’s translation, which I just discovered, is almost identical to mine: “Those attached to perception and views / roam the world offending people.”]