Why is it grammatically wrong to say:
She told me if I wanted to come.
She said if I wanted to come.
I have been told that in this context we must use ask rather than tell or say.
I'd go with
She asked (me) if I wanted to come.
since it's reporting a yes/no question which seems to be an invitation. If that's the case, then I could go with this too
She invited me to go with her.
We usually use tell when we report a statement (rather than a question) indirectly and we use say when we want to report something directly. In other words, use 'say' for exact quotes as in
She said, "let's dance."
and in indirect reports with 'that' as in
She said (that) she loved him.