Using reasoning about the mean
If the mean of two of the lengths is equal to the third length, then the mean of all three lengths will also be equal to the third length.
We know that the sum of all 3 lengths is 20 + 70 = 90, so the mean of all 3 lengths is 90$\div$3 = 30. So we will need to have a piece which is 30 cm long. This will be cut from the 70 cm rod, and the three resulting pieces will have lengths 20 cm, 30 cm and 40 cm.
Other approaches
If you cut the 20 cm rod into pieces, then the pieces will be too small for either of them to be the mean. If one of the pieces is very very short, say approximately 0 cm, then the mean of the longest length (70 cm) and the shortest length (0 cm) will be (70 + 0)$\div$2 = 35 cm, which is still longer than the third piece. If the smallest piece is any longer than 0 cm, then the mean of the longest
and shortest lengths will be longer than 35 cm, so too long to cut from a 20 cm rod.
Instead, the 70 cm rod must be cut into two pieces.
If we cut the 70 cm rod into a piece which is longer than 20 cm and a piece which is shorter than 20 cm, then the mean of the two lengths should be 20 cm. But that would mean that the two lengths added together would be 40 cm - but we know that it can't be, because they are cut from a 70 cm rod.
So the 20 cm rod must be the shortest piece.
Working out the lengths using numbers
We could start by imagining cutting the 70 cm rod in half, and then improving our answer.
Cutting it in half would give lengths 20, 35, 35. Clearly 35 is not the mean of 20 and 35.
Making one piece 10 cm longer and the other 10 cm shorter gives 20, 25, 45. The mean of 20 and 45 is 65$\div$2 = 32.5, which is more than 35.
Making one piece 5 cm shorter and the other 5 cm longer gives 20, 30, 40. 30 is the mean of 20 and 40 - perfect.
Using algebra for the lengths of the pieces
Suppose the $70$ cm rod is cut into pieces of length $a$ cm and $b$ cm, where $a+b=70$ and the longer piece is $a$ cm long.
Then $b$ is the mean of $a$ and $20$, so $a+20=2b\Rightarrow a = 2b-20$.
Substituting this into $a+b=70$, we get $$\begin{align}
(2b-20)+b&=70\\
\Rightarrow 3b-20&=70\\
\Rightarrow 3b&=90\\
\Rightarrow b&=30\end{align}$$
So $a=2\times30-20=40$, and so the $70$ cm rod must be cut into pieces of length $30$ cm and $40$ cm.
Using algebra for the mean and the difference
Suppose the mean will be $m$, and the difference between the mean and each of the other lengths is $r$. This difference will be the same for both of the other pieces, because the mean is the length that balances out these differences. So we have pieces of length $m,$ $m+r$ and $m-r,$ where $m-r=20$ (because the $20$ cm rod is the smallest piece) and $m+(m+r)=70\Rightarrow 2m+r=70.$
$m-r=20$ means that $m-r$ is the same as $20$, so adding $20$ is the same as adding $m-r.$ So adding $20$ to both sides of the equation $2m+r=70$ gives $$\begin{align}
&2m+r+(m-r)=70+20\\
\Rightarrow &3m=90\\
\Rightarrow&m=30\end{align}$$
So one of the pieces should be $30$ cm long, which means the $70$ cm rod should be cut into pieces of length $30$ cm and $40$ cm.