Lovely question! This is where we get to the edge of the word “irrational”.
Rationality is, in modern sciences, often equated with self-interested profit maximization / loss minimization. In other words, you are rational - according to a type of economics which is gradually becoming extinct - if you take care of your outcomes, and try to make them as good as possible.
This would make stuff like helping others, participating in war, parenting, tipping, and, yes, trust, irrational. A weird thing to consider, right?
I say we are at the edge of the word irrational here because there is a difference between what is rational/irrational in the short-term, as opposed to the long term. I deal with social dilemmas and game theory in my work. A typical n-person social dilemma goes as follows: a group of people share a common resource. It could be any number of things - from food, water and shelter, over taxes, health, security, to democracy. In order for our common resource to continue being useful to us, we must all contribute to it. However, every member of the group has a realistic incentive to benefit from the common resource without contributing to its maintenance. In other words, they want to freeride.
An old-school economist might tell you that it is rational for every person to freeride. But if everybody behaved according to this rationality, very soon nobody will contribute to the common resource. It will collapse, and everybody will lose. Thus, in the long run, it is not rational / self-interested to freeride.
The same is true of trust. If you trust somebody, you put power into their hands. We can think of this trust as an investment into your relationship. You can see this working on practically any level of human interaction. When you tell secrets to your friend, you are showing trust, and commitment to the relationship. Your friend can either tell you secrets in return (in which case, you hold each other’s secrets hostage in a way), or they can betray your trust (in which case, they will lose your friendship). When you pay your contractor for their services, you have invested in a business relationship. The contractor can live up to the trust, and deliver, or betray the trust, and run off with your money.
Without this test, establishing new relationships would be very difficult, and people would only be able to positively interact with the people from the same network - people they are already connected to, and for whom it would be difficult to betray each other (this is also called assurance).
Keep in mind, also, that a betrayal of trust is not without cost! A friend who betrays your trust, or a contractor who runs off with your money, will likely gain a bad reputation (not to mention possible legal ramifications), and other people will - because of your testimony - be less likely to trust them. Thus, your former friend and your bad contractor will be left alone, with nobody willing to exchange goods with them anymore. This is as severe a punishment as any humans have.
Without trust, our societies would not work. Trust is rational, in that it is necessary to achieve all sorts of goals. It contains risk - but so does practically anything else. Now, is it rational to trust a particular individual? That depends on what information you have about this individual. Have they betrayed somebody’s trust before? Under what circumstances? Would it be easy for them to betray your trust, or would they suffer consequences for it? Do you have something which would motivate them to come closer to you in order to claim it?