Direct speech is used in creative writing, story writing, narration, informal communication, etc. In some instances, it is used in formal writing too.