Ok, firstly, you have #x-1#, #x+1#, and #x^2-1# as the denominator in your question. Thus, I will take it as the question implicitly assumes that #x != 1 or -1#. This is actually pretty important.
Let's combine the fraction on the right into a single fraction,
#x/(x-1) + 4/(x+1) = (x(x+1))/((x-1)(x+1)) + (4(x-1))/((x-1)(x+1)) = (x^2 + x + 4x - 4)/(x^2-1) = (x^2 + 5x -4)/(x^2 -1)#
Here, note that #(x-1)(x+1) = x^2 - 1# from difference of two squares.
We have:
#(x^2 + 5x -4)/(x^2 -1) = (4x-2)/(x^2-1)#
Cancel out the denominator (multiply both sides by #x^2-1#),
#x^2 + 5x -4 = 4x-2#
Please note that this step is only possible due to our assumption at the start. Cancelling #(x^2-1)/(x^2-1) = 1# is only valid for #x^2-1 != 0#.
#x^2 + x -2 = 0#
We can factorise this quadratic equation:
#x^2 + x - 2 = (x - 1)(x + 2) = 0#
And thus, #x = 1#, or #x = -2#.
But we're not done yet. This is the solution to the quadratic equation, but not the equation in the question.
In this case, #x = 1# is an extraneous solution, which is an extra solution that is generated by the way we solve our problem, but is not an actual solution.
So, we reject #x = 1#, from our assumption earlier.
Therefore, #x = -2#.