So if Ditto's type doesn't change when it transforms into a Ghost type will it be able to not take any hits from Ghost moves but still be able to fire them at the Ghost type and get them to be super effective?
Ditto copies type changes. So if it was copying a Magikarp, it will become water type. Source: Experience
When a dito transforms it literally turns into the opposing Pokemon. It also gets all the moves know by the target. This is only temporary. The dito will remain like this until the battle is over. A normal type dito. So to answer your question ditto will turn into a ghost type if it copies a Pokemon of that type. Same goes to other types
I hope this helped!!!
>Ditto uses the move Transform to copy the opponent's moves, types, form, and non-HP stats.
So yes, it takes the type as well. Copies everything but item, HP and status effect.