Length contraction and acceleration in opposite directions If you accelerate in a direction, objects in front and behind you get closer relative to you. If you then accelerate again in the opposite direction, the same thing happens, which leads to a contradiction. Where's the flaw in my logic?
Let me demonstrate with an example (see diagram)
There are two objects, object A to my left and object B to my right. Both are 1 light year away. I make no assumptions about my velocity or the velocities of object A or B.
I accelerate by 0.9c to the right. The lengths contract to 0.44 light years. I'm in a new frame of reference. Since I didn't use my velocity in the calculations, I can repeat the process. I accelerate to 0.9c to the left from the new frame of reference, and now the lengths are 0.2 light years. This is clearly a contradiction since I'm back to my initial velocity and the objects should be 1 light year away each. Where am I going wrong?

 A: 
When you accelerate right from rest to $0.9c$ you are quite correct that distances are Lorentz contracted so the distant objects get nearer to you. However if you now start accelerating left your speed decreases and eventually goes back to zero, and as this happens those objects return to their original distance. Now if you keep accelerating left until you reach $0.9c$ in the opposite direction the distances will shrink again.
Note that the Lorentz contraction is only a function of velocity. The acceleration makes no difference, except that obviously accelerating changes your velocity. So the lengths won't change the instant you start accelerating. They will only change as your acceleration causes your velocity to change.
A: The length contraction formula tells you the length in frame S' of an object that is at rest in S. If you swap S and S', the object is not at rest in S, so the formula doesn't apply.
To find the correct length in general you need to use the Lorentz transformation, of which the length contraction formula is just a special case.
A more general length contraction formula (derivable from the Lorentz transformation), which applies whenever the object's velocity $u$ in S is in the same direction as the relative velocity $v$ of S', is $\displaystyle L'=\frac{L}{γ(1-uv/c^2)}$. If $u=0$ (the object is at rest in S) then that reduces to $L'=L/γ$, while if $u=v$ (the object is at rest in S') it reduces to $L'=γL$.
