Would a block containing a transaction with an identical hash as a previous transaction be considered valid? That is, if someone made a transaction for generating Bitcoins and solve two blocks with the same coinbase transaction, would the second block using that transaction valid?
The transaction would be valid - there is nothing in the protocol that forbids this.
This is also the cause of the "duplicate coinbase" bug in the Satoshi client which I discovered a few months ago. If you create a block with a duplicate coinbase and that block then becomes orphaned it will cause the both the original and duplicate tx to be removed from the database.
That's valid (and has happened) for coinbase transactions and transactions built off of coinbase transactions. Other than those strange cases, putting the same transaction in the chain twice isn't allowed.
Coinbase duplicates are only allowed due to an oversight. It will be corrected soon.