There are a few versions of this song. The first one is sung in The Fellowship of the Ring first by Bilbo in ‘A Long Expected Party’ and then by Frodo in ‘Three is Company’.

The Road goes ever on and on
Down from the door where it began.
Now far ahead the Road has gone,
And I must follow, if I can,
Pursuing it with eager feet,
Until it joins some larger way
Where many paths and errands meet.
And whither then? I cannot say.

In The Return of the King, ‘Many Partings’, Bilbo sings it again, with slightly changed words.

The Road goes ever on and on
Out from the door where it began.
Now far ahead the Road has gone,
Let others follow it who can!
Let them a journey new begin,
But I at last with weary feet
Will turn towards the lighted inn,
My evening-rest and sleep to meet.

Frodo is the last one to sing it (or the last six lines of it), as he and Sam are on their way to the Grey Havens in The Return of the King.

… Still round the corner there may wait
A new road or a secret gate;
And though I oft have passed them by,
A day will come at last when I
Shall take the hidden paths that run
West of the Moon, East of the Sun.

Research: legolas19 and Hathaldir