What is the difference in meaning between the following sentences?
I have nothing.
I don't have anything.
What is the difference in meaning between the following sentences?
I have nothing.
I don't have anything.
There is a discussion of something similar between the novelists Ford Madox Ford and Joseph Conrad. Ford was trying to explain to Conrad the nuanced difference between "without a penny" and "penniless".
I have nothing could mean "Everything has been taken from me." (e.g. King Lear)
*I don't have anything" could mean "At the moment, I don't have an answer, I don't have any money on me, I have no contraband on my person, etc etc"
To me, the difference is in the subject/verb agreement. I have something. I don't have something. So, which to use depends on which direction the writer or speaker wants the verb to take the subject. Above, the something the speaker has is nothing and the something the speaker doesn't have is anything. A spiritual master could say, "Enlightenment has taught me no thing is Dharma. I have Dharma. Thus, I have nothing." If the master instead says, "I don't have anything", it would ruin the syllogism and the "no thing" "nothing" (sort of) homonym. On the other hand some insecure teen might complain to her friends, "Boys like you because... You've got big hair. You can dunk a basketball. You can sing. You're a science nerd. But me, I don't have anything." If instead she said, "I have nothing", it would work grammatically in the complaint, but it wouldn't be as large of a contrast to the listener/reader. All the friends "have a thing" and the speaker emphasizes she "doesn't have a thing". If that thought finishes with, "I have nothing", then her friends each "have a thing" and so does she, even though the "thing" she has is "nothing".
It's up to the writer (or the speaker themselves) to decide what the speaker wants to emphasize, positively possessive or negatively possessive, I have or I don't have.
(Am I going down a rabbit hole here?) Generally, any pair of "opposite words" will substitute for "nothing" and "anything" above, and the same "I have" versus "I don't have" pseudo-rule applies. "I have love". "I don't have hate". Those two sentences only equate if there is no middle ground between love and hate, if in the absence of hate there is only love, if in the absence of anything there is only nothing. (And you can get into juicy ontological discussions about the nature of reality like "if 'there is nothing', then nothing 'is' a thing and so in the absence of anything, nothing itself would also be absent. No thing survives the absence of anything. So, what do you call what's left when there is nothing left? [Right!]")
"I don't have anything' Is a straightforward negation of "I have something". It implies an absence.
"I have nothing" logically carries the same meaning, but it is actually stronger for most people. It begins with an affirmative "I have" and then proceeds to the absolute "nothing".