Yes, Peter made mistakes. So did all the apostles. But does that mean God could not use them anymore for great purposes? Peter went on to do great things after this incident happened, by God's grace. And his words recorded in the bible were just as inspired by God as Jesus's.
2 Timothy 3:16-17
16All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: 17That the man of God may be perfect, thoroughly furnished unto all good works.