If you mean [tex]f(x)=x+\frac1x[/tex], then the derivative is
[tex]\displaystyle f'(x) = \lim_{h\to0} \frac{\left(x+h+\frac1{x+h}\right) - \left(x+\frac1x\right)}h \\\\ = \lim_{h\to0} \frac{(x+h)-x}h + \lim_{h\to0} \frac{\frac1{x+h} - \frac1x}h \\\\ = \lim_{h\to0} \frac hh + \lim_{h\to0} \frac{x-(x+h)}{hx(x+h)} \\\\ = \lim_{h\to0} 1 - \lim_{h\to0} \frac h{hx(x+h)} \\\\ = 1 - \lim_{h\to0} \frac1{x(x+h)} \\\\ = \boxed{1 - \frac1{x^2}}[/tex]
If you mean [tex]f(x) = \frac{x+1}x = 1 + \frac1x[/tex], we know from above that
[tex]\displaystyle \left(\frac1x\right)' = \lim_{h\to0} \frac{\frac1{x+h}-\frac1x}h = -\frac1{x^2}[/tex]
which leaves the constant term, whose derivative is
[tex]\displaystyle (1)' = \lim_{h\to0}\frac{1 - 1}h = 0[/tex]
and so
[tex]f'(x) = -\dfrac1{x^2}[/tex]