The way to get the same denominator is to multiply each fraction (top and bottom) by the denominator of the other fraction, like this:
2x/(x^2+1) * x^2/x^2 for the first term (x^2/x^2 = 1, so you can multiply by that without changing the value of that term)
and
1/x^2 * (x^2+1)/(x^2+1) for the second term
I'll go ahead and work it a little further so you can be sure you are on the right track:
After doing the steps above, you have
2x*x^2/(x^2*(x^2+1)) - (x^2+1)/(x^2*(x^2+1))
Now, since they both have the same denominator, you can just subtract the numerators and simplify.
Hope that helps.