People would usually indicate the "I am unable to do" with some degree of contraction
I cannot do
I can't do
In both cases, that means that the speaker is unable to do whatever, or has no option to do whatever. The not is bound tightly to the can, indicating that the verb can is what is negated. Without that close binding, it could be the do that is negated.
However, it would be unusual to use "I can not do", without clarifying context for either that meaning or the "I have the option of not doing". It might be used with context like:
I can do it, or I can not do it.
Spoken aloud, the not would usually be stressed.
You can also remove the ambiguity by saying
I can choose not to do it
or
I can choose to not do it
Prescriptivist purists will complain about splitting the infinitive on the second of those; ignore them. People do it all the time. Unless you're writing for someone who actually thinks English has a formal grammar that must be followed at all times, of course.
The second option of that pair tends to emphasise the not, while the first emphasises the choose; spoken emphasis will often match that pattern, though you can use the first word order and stress the not to get the same effect of emphasising the not.
As a question, the not could go either way.
Can't you speak?
That's nice and unambiguous, it is asking them if they can't speak - with an emphasis on the fact that the matter is in question - because they have not spoken, for instance.
Can you not speak?
Could mean the same, or it could be a request that the person stop speaking. Spoken aloud, they would have different stress and intonation. To indicate that are asking if they can speak, stress would tend to be on the you, while the request to stop speaking would tend to put stress on not speak - though that probably depends on dialect.
Lastly, for some verbs in place of do, it would not be unnatural (though may seem archaic or highly formal) to put the not after that verb, rather than between the can and the other verb. Many of these would either be quotations from literature or paraphrases of them, but I wouldn't know - off the top of my head - which were and what they were from. One, of course, is the classic game when stripping petals from a flower:
"She loves me, she loves me not, she loves me, she loves me not (etc)"
(In that game, one pulls a petal from the flower and says "she loves me" (or, as appropriate "he loves me", or whatever), then pulls another and says "she loves me not", alternating until all the petals are gone; whatever you say on the final petal is the supposed result.)
A lot of archaic or poetic texts use "look not", like the Bible's "we look not to the things that are seen but to the things that are unseen"; in that case, the not actually binds to the things that are seen. It is an instruction to look, but at that, not this. On the other hand, "look not into my eyes" (from a poem by A E Housman) is an instruction to not look, then qualified by what it is that one should not look at. It doesn't require one to look at anything, just specifically not to look at another thing. Then, of course, there's the very commonly-used (when someone is trying to sound slightly archaic or formal) fear not, which means precisely the same as do not fear.