The two rules given, \(x \to \frac{1}{x+1}\) and \(x \to \frac{x}{x+1}\), build up a tree of fractions starting from \(\frac12\). Let's grow a few levels of this tree and see the pattern before checking the options.
Starting value: \(\frac12\).
From \(\frac12\): \(\frac{1}{\frac12+1}=\frac{1}{3/2}=\frac23\), and \(\frac{\frac12}{\frac12+1}=\frac{1/2}{3/2}=\frac13\).
From \(\frac13\): we get \(\frac34\) and \(\frac14\). From \(\frac23\): we get \(\frac35\) and \(\frac25\).
Every fraction produced so far, \(\frac12,\frac13,\frac23,\frac14,\frac34,\frac25,\frac35\), and so on, is a rational number strictly between 0 and 1. This is not a coincidence: if \(0<x<1\) then \(1<x+1<2\), so \(\frac{1}{x+1}\) lands between \(\frac12\) and \(1\), and \(\frac{x}{x+1}=1-\frac{1}{x+1}\) lands between \(0\) and \(\frac12\). Both children of any fraction in \((0,1)\) stay inside \((0,1)\), so nothing ever escapes this interval.
What remains is option 1: every rational strictly between 0 and 1 is eventually produced this way. This matches the pattern in the tree above: after 2 levels we already got \(\frac13,\frac14,\frac25,\frac35,\frac34,\frac23\), which are exactly the fractions with denominator up to 5 that lie between 0 and 1 in lowest terms, and going deeper into the tree keeps filling in every remaining rational in \((0,1)\) with larger denominators.
Let's summarize:
So S is exactly the set of rational numbers in the interval \(0<x<1\), which is option 1.