Dude, your tables are not optimized and you're going to have problems later with names, references, etc., such as using the CPF as a user id in the purchasing table. The most appropriate would be to use an auto-increment for a sequential ID and then use it.
Think that when using the CPF you may have problems with the searches (easy to miss typing, will have to deal with cases of invalid cpf's, etc.).
I also think it was not cool to allow the table to be bought with the 2 fields set to null , so what would you store in a case of double nulls?
But since you are a beginner, then this is normal. Do not worry, here is a link for you to learn some basic things about crossing data between tables that will make all the difference.
Meanwhile, this is the code you need:
select cursos.nome, usuarios.nome
from cursos, usuarios, comprados
where comprados.usuarios_id = usuarios.cpf
and comprados.cursos_id = cursos.id;