When to apply Lorentz transformations and laws of time dilations and length contractions: explanations 
In the laboratory we are observing the motion of a particle moving in the positive direction of the axis $x$ of a frame system attached to it. At the initial moment, the particle is in the origin and in a time interval of $2.0$ ns covers a distance of $25$ cm. A spacecraft passes with velocity $v = 0.80c$ along the $x$ direction of the laboratory, in the positive direction, and from it observes the motion of the same particle. Determine the average particle speeds in the two systems of reference. What interval of time and what distance would an observer placed on the spaceship?

Why can't I use the formulas of time expansion and length contraction, but instead I must use the Lorentz transformations?
 A: 
Why I can not to use the formulas of time expansion and length contraction and I must applicate, necessary, Lorentz transformations?

The time dilation and length contraction formulas are derived from the Lorentz transform using some specific assumptions. For time dilation the assumption is that the clock is at rest in one of the frames. For length contraction the assumptions are that the endpoints are at rest in one of the frames and that the length is constant. 
In this problem you cannot use the length contraction or time dilation formulas because the assumptions are not met. The particle is not at rest in either the lab or rocket frames. 
As an aside, I recommend that new students of relativity not use the time dilation and length contraction formulas at all. They are too easy to misapply as in this problem. Just use the Lorentz transform, it will automatically simplify when appropriate, and you will avoid misapplying them when they are not appropriate. 
A: IMO newcomers (and teachers) in SR should avoid both time dilation and length contraction. I add Lorentz transformations too. Too often they are applied mechanically, without understanding how and why. The most basic instrument in SR is invariance of spacetime interval. It's enough to solve all elementary problems.
So I welcome @Aretino 's comment. There is however a weak point. In Aretino's solution use is made of RTV - relativistic transformation of velocities (I prefer "transformation" to "addition" or "composition" but I can't dwell on that here). Now RTV formula is usually established through Lorentz', so it looks that Aretino's solution couldn't avoid them.
That's not true since RTV can be proved using only invariance of interval (admittedly in a longer way). I believe this proof isn't widely known, although I'm pretty sure that there are books containing it. I'm afraid that reporting it here could be deemed as OT.
A: Let distance be $D=25cm$, you are asking why we can't just use $D'=D/\gamma$ (length contraction) and $t'=\gamma t$ for $t=2ns$ (time dilation) so that we calculate average speed in spaceship's frame as $u'=D'/t'=u/\gamma^2$ where u indicate velocity of particle in the lab frame? If it's your question then it's an easy one, intuitively speaking it's because spaceship moves in $x$ direction as well, same as particle. If spaceship were to move in y axis, you could use time dilation to conclude that speed is $u'_x=u/\gamma$ but now that spaceship moves in x direction, you should consider this fact that spaceship will ascribe his speed to particle too!
A: Well, firstly, think of how the length contraction formula came. We used $∆t'=0$ in the inverse Lorentz transformation, right?
Why did we did that? Because, to measure a length, you have to measure the both end at the same time. But, here the space time coordinate measured at the same time. First coordinate is measured at $t=0$, and second one is at $t=2$ ns. So length contraction is not valid here.
I myself faced the exact same problem at the first days of my learning relativity. I recommend you to go through the derivative of length contraction again.
