As a non-native English speaker, I am not sure if this sentence is correct or if it should be "If you had gone to school, you would know how to write". Anybody?
It's correct if it means at a specific time in the past. Knowing how to write is generally a pretty long-lasting state and you're more likely to talk about your abilities now than at another time, so your sentence would be much more common.