Consider your bosses actions a great compliment! Hes older more experienced and should be wiser. He is likely threatened by your skills and abilities. When you do better work than the people that have been there longer your going to rub a few the wrong way.
I have done it several times. I dont concern myself with their petty selfishness. Do your job well and when given the opportunity shine when your bosses superiors are near! Make it clear your putting the company first and not your bosses ego first.
I had a boss that kept saying my ideas and approaches are stupid and worthless. He would then take them and put his name on them and say they were his ideas shortly after telling me they were pointless and dumb. I caught on after seeing three of my ideas get implemented into company work method changes under his name. Its not to hard to see when your own ideas being implemented.
After that I started land mining the better ones I knew he would take. Upper level management is typically not too dumb and when the great ideas he was proposing did not work and he had no explanation for it while some new nobody kid could step right in and explain the whole concept and its fatal flaw without so much as a stutter it didn't take to long for them to figure out who the originator was.
We played this game for several months and I just kept learning more and more of his job until one day he called in sick and his superior asked me to work late and try and do some of his office and managerial work.
I said no problem. I told his boss I may not know everything about what to do so can you help me out if I need it. He said sure and gave me a list of what he did in a typical day and I went to work.
Two hours later I had my bosses full day schedule knocked out and asked if I could go home. His boss couldn't believe I did it so quickly and easily. I told him everything you needed me to do I have been doing in my side time on night shift for a month or better now and most of what was on the list I had done last night before the day shift even came to work!
Turns out I was doing the majority of my bosses job for some time. It didn't sit well with the upper level. That parts ordering, shipping and receiving of high dollar company equipment and work order review stuff was not part of my job description.
Also my finding out from my bosses superiors that I was not the lowly night shift maintenance supervisor as my boss made me believe but acting plant manager of a multi tens of millions of dollars facility with 30 - 40 people under me was to much! In the time I had worked there I was never properly trained for supervisory or shift management work or procedure and thus not officially authorized for doing it.
After that I wrote up my two week notice ( I couldn't handle the pressure I was scared to come to work!). My boss attempted to fire me on a Wednesday to cover his screw up. However I was turning in my notice that Friday.
I mailed my notice letter to his boss anyway along with a big writeup of other things I had been doing under his orders too. After my my letter got around the company (I had friends that worked there that kept me informed) There was a big company investigation to see if what I said in my letter was true or what he said he fired me for was true. It raised a few very big eyebrows!
My former boss got put under a very fine corporate micro scope and had to do his job himself or get run off. (I would have fired him right there myself) Plus for the gross negligence of putting me in unauthorized and untrained work positions, the rumor was he lost his big year end bonus of some 10's of thousands of dollars!
Officially I quit. Everybody still only sees the fired part for what ever reason after. Either way He got what he deserved and officially my name was cleared.
Keep track of what you do and who's job it really is. Take on extra work if you can handle it. Your present day coworkers and superiors are going to watch out for their best interests at your expense so return the favor!
Put the company first and make it apparent to everyone that you are doing so! It will pay off!
Play smart but look enthusiastic and unsuspecting, Its in your best long term interests!