You do it digit by digit.
You want: . You have , so .
You want: . You have , so .
Etc.
Turning two-line notation into three-line notation:
Essentially, the first two lines show where sends numbers while the second two lines show where sends numbers. So, the first and last line show where the composition sends numbers. To write , just write the last two lines, but order the columns so that the top row is in order:
In case it is not obvious to the OP, is extremely easy to calculate. You are given that , so its inverse is just flipping the two rows:
So, now, the product (composition) of the two permutations: is easy to calculate (and gives the same answer as above). Generally, as you continue in mathematics, Plato's solution is going to be easier to apply.
, so multiplying both sides by on the right, you get . On the LHS, is the identity permutation, so the LHS simplifies to . So, it is not that , but that you are multiplying by the identity permutation, so you are not changing it. If you send 1 to 2, then send 2 back to 1, it is the same as if you never sent it anywhere at all. That is how multiplying a permutation by its inverse gives the identity permutation.