Does a long deck beam need a post at staggered joints?
How are you joining these 2x12's?

Who has done the load and deflection calculations to ensure that a 3.5" x 11.5" x 40' wood beam can handle the load you want to put on it?

What kind of load are you expecting the finished deck to hold?

Is this thing up in the air, or close to the ground?

You've considered that your finished beam is going to weigh somewhere around 550 to 600 pounds all by itself, right?  ;-)

If your beam is nailed or screwed together

If you're making your composite beam by nailing or screwing the 2 x 12's together, I would absolutely expect you to need a post under each staggered joint. I probably wouldn't want to stand under it otherwise, unless you used so many nails or screws that it looks like rows of rivets. Because a big chunk of the load will be hanging (a shearing force) on the nails or screws, and on the small section of the 2 x 12's that the nails or screws are in contact with, rather than the load being born fully along the length of the beam.

No engineering calcs or diagrams here; but in an unbroken beam most of the load is actually handled along the top and bottom of the beam, which is why I-beams are so strong yet so light, and why you can cut big holes through the center of the beam. The thin vertical part of the beam keeps the wide top and bottom surfaces of the beam separated, and those surfaces are what bear the load.

So if you put a post under each staggered joint, then the 2 x 12's will share the load and transfer it to the posts and the nails or screws won't be bearing any shearing force/deflection load. They'll just keep the 2 x 12's together, and you won't need all that many of them.

If you build the beam with adhesive

It's a different story if you're building the beam up using some kind of permanent, waterproof construction adhesive (and you'll need a lot of it).

If you're using glue to make your beam, you're definitely going to need a few friends to help you move it into position after the glue has set.

You need to clamp the 2 x 12's together hard while the adhesive sets. You could use clamps (a lot of them), or lay the beam out flat and use weights (sandbags, whatever), or you could use screws. If you use clamps or screws maybe you could build the beam in place as you go, using temporary posts to hold it up as it sets.

I'd also expect that you would use the same adhesive liberally on the ends that butt together and make sure they are pressed hard together while they set.

Still, since you're making the beam yourself rather than buying engineered prefab beams, I think there's a fair chance you'd end up with a beam that's still weaker at the joints than an engineered beam would be.

And you do need to have an engineer or architect do some calculations to make sure that 40' beam can do what you expect it to.