Hence, there's the endeavor called collaborations. It is actually a good thing, and it is something I recommend. It is actually more interesting when one is working with someone else, rather than working alone. And here's why.
First, working with someone gets you a sanity check. If you work alone, then there is a higher chance that you'll probably be delusional at some point, believing that you have the correct answer to the most profound questions of the universe (or at least, of your subfield) that you fail to consider other alternative explanations. It is always better to have two thinking heads than one. Of course, even though one has collaborative work, it is always a good idea to have people outside the project view it too, and get their comments.
Second, working with someone diversifies your profile. Personally, I have collaborated with a few people on topics that are unexpected, given my own personal interests. Some might say that I have collaborated simply because I wanted to pad my CV, but actually that is not the case. I just happen to be someone whose interests intersect with quite a few people. And the more people one's interests intersect with, the easier collaboration can be. It shows that one is potentially versatile, and that one has the ability to work together in a group, in addition to working on one's own.
So those are just two reasons why one would want to collaborate. So how does collaborating start? Well, one first has to talk.
In my experience, my collaborations mostly involved people having theoretical questions but needed some empirical evidence to answer these questions. I happen to enjoy designing experiments, regardless of what topic it is in, so most of my collaborations are like that. Aside from that, I have had chats with people where we thought we could join forces together, and so that was how things started.
Aside from people in one's department, conferences are great venues for seeds of collaboration to be planted. You meet people from other places, you chat with them during coffee, you raise a question, or they raise a question, and soon enough, you both will be puzzling over it, hopefully enough to begin a research program together.
So I guess the lesson is that one shouldn't be a rock or an island when it comes to graduate school. One should not hesitate to talk to others, discuss with others, as chances are the others might very well help you when it comes to solving your problem. The important thing, after all, is to solve the problem. That is what science is about. Personally, I'd rather have the scientific problem solved by a group, if by doing so, it will be solved faster.