And just to tie off any possible loose ends, so to speak, no you can't tie a granny knot in an infinitely long string. You have to fold the ends over and under each other to make a granny knot, and an infinite string has no ends. But you can tie other kinds of knots in it.
Arrange your infinitely long string into a Cornu spiral (or something similarly compactified), tie whatever knot you like.