Well,No one would use it in an essay or something like that,isn't it true?No, not "informal"; it's incorrect. It's used by educated people only in a joking way.
You did not misunderstand.I misunderstood your question. If you wanted to use it (and make everyone's elementary English school teacher roll in her grave):
I ain't going to do that.
You ain't supposed to say ain't.
He ain't going to say ain't.
We ain't going to say it.
You all ain't going to say ain't ?
They ain't going to say it. There ain't no way.