I think partly it may be down to how you're setting up the situation and incentivising the players. You haven't told us what the players are doing, their alignments or their aspirations, so if you could add that it would be helpful.
My assumption is that your players are all relatively good/neutral characters who are primarily playing DnD to have fun. They are playing archetypal heroes and want to feel powerful.
Give the players a reason to want to act
In every quest and every encounter, you need to ask yourself 'why would the players want to spend time and energy on this'. If the answer is not immediately obvious, then you're going to run into situations where the players just don't care enough to get invested. Is there a material reward in it for them? Does it get them something they want (not eventually, but at this moment in time)? Will it hurt their enemies?
Make sure the players know the possible outcomes
If they steal the Sceptre of Ultimate Power, what will it give them? Can they use it on themselves? Can they sell it? Will other people come after it? Will they need to hold on to it for months before it can be useful?
If the players are constantly blindsided by unforeseen consequences, they're going to be more leery in the future. This usually manifests itself as them players not getting too attached to anything because it can be taken away. This is a problem for you as a DM because if you make a quest, and the players aren't 100% sure of the possible outcomes, they'll usually default to 'do nothing, at least then it won't be our fault'. You want your players to trust you and trust your world, so that they know when they can take risks and what's at stake.
Dangle hooks with the right kind of bait
Is your group a collection of lawful good paladins? Then quests that promise them riches and access to vices probably won't be very effective. Are your PCs already rich? Then gold probably isn't a very good motivator (but a rare item probably is). Are your PCs mostly selfish or indifferent to suffering around them? Then you probably can't entice them into protecting a local orphanage for free.
As one of the comments above suggests, it looks like your players are more 'bored' than 'stuck'. It's not that they couldn't figure it out if their lives depended on it, it's more that they don't really seem to care one way or another. Given that, I have some questions you can ask yourself about your posted quest to try to determine where is issue is:
the players would be investigating in a town that had some problems with trade caravans being attacked
Why do the players care that caravans are being attacked? Other than the obvious 'because attacking caravans is wrong', what motivation do they have to find out who is attacking the caravans and how to stop them? Are the caravans carrying supplies to an ally of the player? Do the caravans contain important reagents for the creation of a wondrous magic item that the players are expecting to receive? Could the caravans be concealing a local politician who promises to help the players out if they can get him safely to his destination?
In a general DnD world, it's expected that caravans get attacked. Why would your players risk life and limb, in addition to the time and money required to pull off the defense?
They started at the local Sheriffs office who tipped them that a local relatively new thieving guild was active in the area. The thieving guild wasn't raiding the caravans, but I thought it might add a little plot twist to get the guild involved.
Why should the players go investigate a guild? Why is it important to do the sheriff's job for them? Other than caravans losing some materials, what is the big-picture problem that these thieves are posing?
This also calls into question the logistics of that the PCs can expect. In my mind, a thieves guild is likely to have dozens if not hundreds of members, so walking into their den is likely a bad idea. However, thieves are also generally great at stealth, so trying to sneak an entire party in is probably not going to work. Finally, thieves are usually expert liars, which is going to make any social encounter a real pain to pull off.
Also, having a PC lie to the party can work ('hey, the sheriff lied to us! Maybe he's in on it...'), but it can just as easily backfire ('Great, so we just wasted two sessions investigating a guild that was innocent because the one person we can talk to about this was wrong'). I've played in campaigns where we spent lots of time trying to solve a mystery, only to find out that the 'mystery' was just one person constantly lying to us about what was going on. The end result didn't make us feel cool or heroic, it just made us feel sort of dumb and that we'd wasted our time.
Is there any specific reason that the party would feel driven to solve this crime? What is the party going to learn from the thieve's guild?
My thought was to have the PCs eventually figure out that the guild wasn't behind the problem and would need to investigate the local country-side to discover the problem.
This doesn't sound like an amazing plot-twist revelation ("IT WAS THE BUTLER ALL ALONG!?"). It seems like an annoyance after they trusted the sheriff and spent time investigating. What is the purpose behind them being misled? What would make them think to investigate the countryside? Do they have access to any of the caravan drivers to get additional information about the plot, or would they just have to start wandering around and hoping they stumble into the correct answer? And again, why do they care about this particular caravan issue at all?
The players were often confused and unsure what to do.
Confused and unsure is the perfect time to drop a massive hint on them. They overhear a conversation between two bandit leaders about a third upstart that is poaching their business (and where the upstart is likely located). A wounded merchant stumbles into the party's camp and tells them they've just been waylaid and the bandits are running away right now. A distraught widow offers the party her life savings to avenge her husband who went looking for the real thieves at this specific location. One of the hardest things as a DM is to realize that what might be 100% clear to you is probably 100% opaque to the players. If they're confused, it means they need more clues.
They were eventually invited to a parley with the thieves guild but were not sure what to do with the thieves, so eventually just attacked them.
It sounds like you have some smart players! Who in their right mind would go to a parlay with a group of people who call themselves 'The Thieves Guild'? What would be the purpose of it, given that you can be 100% certain that you couldn't trust a word they said? Are your players the sort of people who would ally themselves with thieves? Would being a 'friend of The Thieves Guild' suit them well in this campaign, or would it lower their social status? Do your party members even need thief friends right now? Is anyone in your party particularly thieve-y?
I think if you look into answering these questions, you'll start to get an idea of why your PCs don't seem to care a whole lot about this.