Why cant i root my device to fix google services error?

A

AC Question

So this problem started by i could not connect to google play store and then i could not connect to any google account or google services and tried to look it up but i did not find anything so I tried to unroot my device and then i found a fix for the problem, that i could put # in front of the IP in hosts file but i did not have root so i was going to root my device but then my device did not show up in odin, then i tried kingoroot and framaroot, always getting root failed. But i could get root browser and find the hosts file but when i try to edit it i cant save it i just get error that says saving file failed.

so what can i do? please help!

Samsung galaxy s4 I9505
Android 5.0.1