Yes, you can buy and sell stocks on the same day provided the market is open. In Australia, the ASX is open between 10am and 4pm Sydney time.
Yes, you can buy and sell stocks online. In fact, buying and selling online is the 21st century norm for investors and there is no shortage of online brokers allowing you to trade shares online.
Yes. By buying or selling shares, you are not precluding yourself from taking the opposite action down the track.
Yes, and this can be a practice to minimise capital gains tax bills. Even if you buy back the same shares immediately after selling them, the selling represents a so-called ‘CGT event’, meaning an incident that gives rise to a Capital Gains Tax (CGT) liability.
You can buy and sell the same stock repeatedly, there is nothing wrong with the practice in and of itself. But repeated engagement of this practice might draw suspicions from regulators of illegal activity such as for market manipulation or insider trading.