Based on the story you provided, it appears that the white chalky and crumbly gunk is mineral buildup, commonly caused by hard water. The dark gunk is likely organic material, such as hair, soap, and food particles that have accumulated over time.
The part that you have identified correctly is the trap, which is designed to prevent sewer gases from entering the home and to catch debris that might clog the drain. The other parts in the pictures are likely various types of connectors, elbows, and pipes that are used to connect the sink drain to the wall or floor drain.
To identify the name of the other parts and ensure you buy the right size, it's best to take the old parts to a hardware store or home improvement center and ask for help finding the matching replacement parts. It's important to note that pipes come in different sizes and materials, so you'll want to make sure you get the right ones for your specific application.
As for replacing like for like, it's generally recommended to use the same type of materials and parts that were originally installed, unless you have a good reason to make a change. If the pipes were fitted weird to begin with, it's best to consult a plumber or a professional to assess the situation and recommend the best course of action.
In terms of fixing any potential fitting issues, it may require adjusting or replacing some of the pipes and connectors to ensure a proper fit. Again, it's best to consult with a professional if you're unsure how to proceed.
Overall, replacing the pipes is a common DIY project, but it's important to have a basic understanding of plumbing and to take the necessary precautions to avoid leaks and other issues. If you're unsure about any aspect of the project, it's best to consult with a professional plumber."