QQ,
No no. You do not built up resistance to the antibiotics if you dun finish the whole course. The bacteria in you built up the resistance. For example, there was once I have a cough for more than a month even after eating antibiotics (and I finished the course), the doc have to give me a different type of antibiotics cuz he said the bacteria that I got is already resistance to the original antibiotics given to me. Now, i could have been infected by someone who did not finish his or her course of antibiotics and is therefore breeding the resistant bacteria in their body. Bacteria have this special DNA called plasmid. This is separate from the main chromosomal DNA. These plasmids can be exchanged between different species and strains of bacteria and often carry antibiotics resistance genes.
How do bacteria gain resistance? It is evolution at work. Now, imagine a group of bacteria happily living in your body. You attack them with antibiotics. Either they all get wiped out or one or two which has mutations in their DNA survived the attack. These bacteria with the antibiotics resistance either get wiped out by your own immune system or they are lucky enough to survive and start multiplying. They will be lucky if you stop the antibiotics halfway cuz the body immune system will have to deal with other bacteria beside the resistant ones. This give chance for the resistant bacteria to multiply and maybe pass their resistance genes to others.
Our body is a fertile ground of bacteria, viruses and parasites ALL the time. We always have them in us. It is when they reproduce in large numbers and start producing toxins that we recognise their presence.
Selection process works faster on bacteria than other organisms because bacteria can multiply faster. Some within a few minutes.
Same selection process works on the thalassemia genes. By right, thalassemia is fatal for those who get it and should have disappeared from the gene pool but because carriers of the gene are immune to malaria, the thalassemia gene become prevalent in areas infested with malaria.