I'm going to assume you are a software engineer / programmer. I don't think you will be very successful as a 1099 civil engineer freelancer. :)
Sounds like you are very young. When you say, "The fact that nobody even seems to notice whether I'm doing work or not makes me feel even more apathetic as I realize that most of my job is busywork that nobody cares about anyway", you *almost* got the right conclusion. The right conclusion is that MOST PEOPLE's jobs are busywork that nobody cares about anyway. Or, to be more accurate, most people's jobs are about 20% real work that is actually productive, and 80% doing stupid shit like having meetings, surfing the net, chatting at the watercooler, sending emails, filling out paperwork, etc etc.
Your boss has already figured out that most people waste a lot of time at work - it's the nature of office work. And it's especially the nature of "knowledge" work like IT -- productivity comes in spurts, when you're "in the zone". Nobody can be productive 40 hours a week unless they're on Adderall. Your boss knows this, so he doesn't hassle you when it seems like you're not working because most of your coworkers aren't getting that much work done either.
One thing you've got going for you, is that it *bothers* you when you're not being productive or when nobody cares whether you are or not. I'm the same way. All you have to do is make sure your boss is aware of what you're producing/delivering. CC him on those emails where your customer thanks you for the good job you did, etc. Let me tell you -- it won't take much to impress your boss because most people spend a lot of the day playing games on facebook, or surfing the net, or even just sitting at their desks doing ABSOLUTELY NOTHING. And the opposite works too, after a while of people figuring out that you are actually one of the more productive workers, more work will end up landing on your desk, and then you can start CC'ing your boss on requests that come in so your boss knows how busy you are and can play interference if needed to keep you from getting overwhelmed or burned out.
From the way you write -- I can feel the frustration in your words -- it sounds like you and I are a lot alike. Although many people would consider it arrogant of me to think that I am one of them (and I do), when it comes to programming there really are the 5x, 10x or more guys that can just code circles around most of their teammates, even the ones that have been programming for decades. It's just part of the game, there are some people that are naturally good at it, to the point where they can outproduce "normal" workers by orders of magnitude.
You have to find your own ways to keep yourself in balance. I've been at this a while, and figured out how much time is wasted by most people who work in cubicles, and so I don't feel a shred of guilt that I'm on the clock while I'm sitting here typing out this reply to you. Because no one can work at full speed all the time, you need breaks, plus you need time for your subconscious to work on difficult problems that your conscious mind is having trouble grappling, plus you need time to stay up-to-date and familiarized with the latest tools and techniques of your craft, etc etc.
There are some days when I literally get ZERO work done. Sometimes that's because other people need my help, or want my opinion and so request I attend a meeting, or whatnot. And sometimes it's because I am working on a really difficult project and am stuck on a particular infuriating part of it (or debugging some especially devious bug) and need to let my subconscious work out an elegant solutions. And sometimes I just don't feel very productive, and end up spending the whole day reading MMM and HN (hacker news).
It's okay. Take a deep breath. If you work in a cubicle farm, listen to your coworkers -- how many of them are typing right now? I bet it's a small percentage of the number of people in cubicles near you, and you can hear them if they type, they're just not working. Even if they're programmers. (Especially if they're programmers). Don't sweat it.
I have come to the realization that my brain is valuable for my employer to have on tap. That doesn't mean it has to deliver output for 40 hours a week. It just means I need to be *AVAILABLE* for 40 hours a week. Fortunately, I have bosses that used to be programmers themselves so they understand, and they don't watch what time I show up at the office or what time I head out. There *are* good bosses like that. If you have a shitty boss or a shitty job that just demands too much of you, look for something else. Programmers / software engineers are in extremely high demand right now, it won't be hard to find a better job if you really hate this one. But just make sure the job you have is actually shitty, don't just leave simply because you've become used to it (hedonic adaptation) and so the "newness factor" has worn off and it's no longer exciting because it's no longer new -- then changing jobs will, as you've found out, only make you happy for a few months and you will end up right back in the same spot.
And if you're an electrical, mechnical, civil or aerospace engineer, ignore everything I just said. As it's not really the same. :)
Hope this helps you!