Can good character replace prayer, fasting and charity?
No, they do not replace them. The two belong together. Good character, above all truthfulness, covers a very large part of what is good, and prayer, fasting and charity are meant to shape and strengthen exactly that character.
Truthfulness, faithfulness, honesty with what is entrusted to us, chastity and consideration for others have a very high rank in Islam. So some ask whether good character makes prayer, fasting and charity unnecessary. But Islam does not separate the two. Good character shows how far faith reaches into everyday life, and worship gives it the strength to do so.
Take truthfulness alone. Whoever truly always tells the truth simply cannot commit many sins any more. His room for wrongdoing becomes small. A liar, on the other hand, has every door open. Add faithfulness, honesty with what is entrusted, chastity and refraining from all harm, and hardly any evil is left. Whatever does remain is outweighed by so much good.
There is a story of a thief who asked for just one piece of advice, because he did not trust himself with more. The advice was never to lie. He thought that was easy. But when he set out to steal at night, he thought, tomorrow they will ask me, and I am not allowed to lie. So he stayed at home. This happened to him with one bad deed after another, until in the end he became a pious man. Truth is even an attribute of God Himself.
So prayer, fasting and charity do not stand against character. They are the road that leads to it. The verse above says that prayer restrains a person from indecency. A prayer that does not make someone more honest and kind has missed its aim. Good character without a bond to God, on the other hand, easily loses its footing. Together they make the person Islam hopes for.