How can I set up e.g. when I type www.example.com (so, my domain which I have access) to points to https://stackoverflow.com/questions/ask (I don't have acces, I just want to redirect there) using A record or CNAME in my domain name register?
There are two ways of doing this; DNS and HTTP redirect. If you use DNS, you can only redirect the www.example.com to stackoverflow.com only (not its sub-directories). Another approach is to create .htaccess in your www.example.com and redirect the page to https://stackoverflow.com/questions/ask. Please read here
It seems you need to take the second approach because you want to redirect your users to specific sub-directory.