I am confused with the following permutation. Suppose $\sigma,\tau\in S_n$ the permutation group of order $n$. Define $\sigma.(x_1,x_2,\dots, x_n)=(x_{\sigma(1)},x_{\sigma(2)},\dots, x_{\sigma(n)})$. (it affects on the indices directly, no matter where is it) Using this definition what is the flaw of the following? $$(\tau\sigma).(x_1,x_2,\dots, x_n)=\tau.(\sigma.(x_1,x_2,\dots, x_n))=\tau.(x_{\sigma(1)},x_{\sigma(2)},\dots, x_{\sigma(n)})=(x_{\tau(\sigma(1))},x_{\tau(\sigma(2))},\dots, x_{\tau(\sigma(n)}))$$
On the other hand, one can compute it as follows (the correct one):
$$(\tau\sigma).(x_1,x_2,\dots, x_n)=\tau.(\sigma.(x_1,x_2,\dots, x_n))=\tau.(x_{\sigma(1)},x_{\sigma(2)},\dots, x_{\sigma(n)})\stackrel{\text{let } y_i=x_{\sigma(i)}}{====}(y_{\tau(1)},y_{\tau(2)},\dots, y_{\tau(n)})=(x_{ \sigma(\tau(1))},x_{ \sigma(\tau(2))},\dots, x_{\sigma(\tau(n)})).$$
I think the confusion point is because of I am acting the $\tau$ and $\sigma$ in wrong order but I don't know how to justify it just using the definition $\sigma.(x_1,x_2,\dots, x_n)=(x_{\sigma(1)},x_{\sigma(2)},\dots, x_{\sigma(n)})$.
The subtlety is that if you want to act on the subscript indices "directly", this needs to be a right action (not a left action). If you write it like
$$ (x_1,\dots,x_n) \cdot \sigma = (x_{\sigma(1)},\dots,x_{\sigma(n)}) $$
Then I think it will work out.
If you want to keep it a left action, you should use the inverse permutation:
$$ \sigma \cdot (x_1,\dots,x_n) = (x_{\sigma^{-1}(1)},\dots,x_{\sigma^{-1}(n)}) $$
Now when you evaluate $y_{\tau^{-1}(1)} = y_{\sigma^{-1}(\tau^{-1}(1))}$, this works, because $\sigma^{-1} \circ \tau^{-1} = (\tau \circ \sigma)^{-1}$.