Yes, in your example the sender assigned some funds to the same output script that they just spent coins from. Address reuse is permitted, but should be avoided as it unnecessarily reveals common authorship of transactions.
Funds are not actually accumulated on addresses but each output is tracked separately in the form of unspent transaction outputs (UTXOs). If you receive two payments that both credit Address A, you will have two UTXOs that have the same spending conditions which still must be consumed in two separate inputs, even if you want to spend them in the same transaction.
When spending a UTXO, it is consumed in full. The available value may then be assigned to outputs. The remainder of funds not assigned to a recipient becomes the transaction fee. If, in your example, Alice had a single UTXO of 3 BTC value and wanted to send 0.5 BTC to Bob and 0.5 BTC to Carol, she would have a remainder of 2 BTC. To prevent paying 2 BTC in transaction fee, she added a so-called change output to reclaim the remaining funds. As described above, it would be preferable, if Alice had used a new address A' that she also controls.