The given differential equation is:
\[
\frac{dy}{dx} + y = \frac{1 + y}{x}.
\]
Rewriting it:
\[
\frac{dy}{dx} + y = \frac{1}{x} + \frac{y}{x}.
\]
Now, rearranging the terms:
\[
\frac{dy}{dx} + \frac{y}{x} = \frac{1}{x}.
\]
This is a linear first-order differential equation in the form \( \frac{dy}{dx} + P(x) y = Q(x) \), where \( P(x) = \frac{1}{x} \) and \( Q(x) = \frac{1}{x} \).
The integrating factor \( \mu(x) \) is given by:
\[
\mu(x) = e^{\int P(x) \, dx} = e^{\int \frac{1}{x} \, dx} = e^{\ln x} = x.
\]
Thus, the integrating factor is \( \boxed{x} \).