I have been thinking a lot about what it means to be a good teammate. I have also heard people discussing about your work not being yours, but the teams'. I'm a big believer in collective ownership, we all own the code on the team.
I think many software engineers are not really in a team, but instead, a group of people split out and working in silos, collaborating rarely, trying to accomplish something. But it never feels like a team.
The term team has its meaning.
I think if you're a part of a team, you will feel it. Otherwise whatever you are a part of, is probably not a team.
As for being a good teammate, it is understanding that your work isn't your work. Anyone else's work isn't their work. You understand, care, and have empathy for the entire team's work.
Let me give you a practical example. You finished your task, what's the first thing you do next?
Do you pick up another task?
A good teammate's instincts and thoughts are first to check with their teammates. How is our work going here? Can I help? Do you need anything? Is it cool if I pair code with you and support you on this task? I don't want to pick up a new task, I want to help us finish what's in progress already.
A good teammate is someone who is a part of the team. They understand that whatever they work on, the team is working on.
You don't get shit done, your team does. If someone else gets shit done, it's the entire team that got it done.