I find it students understand this more when there are less parentheses, so... Lets say u = g(x) = \(\displaystyle \frac{1}{x-3}\). You want to find f(u).
If f(x) = \(\displaystyle x^2+1\), then f(u) = \(\displaystyle u^2+1\)
But what is u? u = \(\displaystyle \frac{1}{x-3}\), so, f(u) = \(\displaystyle (\frac{1}{x-3})^2 + 1\).
Simplifying,
\(\displaystyle (\frac{1}{x^2 - 6x + 9}) + 1\) = \(\displaystyle (\frac{1}{x^2 - 6x + 9}) + \frac{x^2 - 6x + 9}{x^2 - 6x + 9}\)
Finally,
f(u) = f(g(x)) = \(\displaystyle \L\\ \frac{x^2-6x+10}{x^2 - 6x + 9}\)