my question is can an item be the sell of the previous transaction, and at the same time the buy of another one?
Can we buy and sell something in the same day?

you can, it's just like you wasted one chance of transaction. For example, if you bought on Day 1 and sell on Day 5 and bought on Day 5 and sell on Day 10. Profit is P5  P1 + P10  P5. It has the same profit as bought on day 1 and sell on day 10(P10  P1). So it is like that the problem ask you to make at most 2 transactions and you only did one.