How would this double spend attack be prevented?
Transactions create Unspent Transaction Outputs utxo. UTXO are uniquely identifiable. UTXO are indivisible, they are destroyed completely, when money is spent from them. (Which is why you need to send change back to yourself.) 
Naturally, this also means that you cannot chose what address you send money from, in fact the "sending address" only exists implicitly by being the address that received the funding payment.

So, putting all this together, whenever someone tries to spend money, the network's nodes check if the corresponding UTXO are available to be spent, i.e. listed in the set of UTXO. 

If somebody tried to spend money twice, the UTXO would have been consumed by the first transaction already, and would therefore no longer be listed in the set of UTXO.