I have heard people saying not to scatter nails and to throw it inside the restroom or to bury it. What is the source for it?
אמר ר"ש בן יוחי ה' דברים הן שהעושה אותן מתחייב בנפשו ודמו בראשו ... והנוטל צפרניו וזורקן לרה"ר ... והנוטל צפרניו וזורקן לרשות הרבים מפני שאשה מעוברת עוברת עליהן ומפלת ולא אמרן אלא דשקיל בגנוסטרי ולא אמרן אלא דשקיל דידיה ודכרעיה ולא אמרן אלא דלא גז מידי בתרייהו אבל גז מידי בתרייהו לית לן בה ולא היא לכולה מילתא חיישינן ת"ר ג' דברים נאמרו בצפרנים שורפן חסיד קוברן צדיק זורקן רשע
R. Simeon b. Yohai stated, There are five things which [cause the man] who does them to forfeit his life and his blood is upon his own head: ... removing one's nails and throwing them away in a public thoroughfare ...
'Removing one's nails and throwing them away in a public thoroughfare'. [This is dangerous] because a pregnant woman passing over them would miscarry. This, however, has been said only of a case where one removes them with a pair of scissors. Furthermore, this has been said only of a case where one removes the nails of both hands and feet. Furthermore, this has been said only in the case where one did not cut anything immediately after cutting them but if something was cut immediately after they were cut there can be no danger. This, however, is not [to be relied upon]. One should be on his guard in all the cases mentioned.
Our Rabbis taught: Three things have been said about the disposal of nails: He who burns them is a pious man, he who buries them is a righteous man, and he who throws them away is a wicked man.