Give to charity because someone needs help not to show off. Remember that your prayers are directed to God, not to impress somebody. Fast in secret rather than in public.Jesus assumes that they will give liberally and ungrudgingly (see Deuteronomy 15:10-11), that they will pray often (perhaps three times a day, see Daniel 6:10, and that they would fast (see Joel 1:14; also see Isaiah 58 to see that fasting was not restricted to food).
What Jesus is cautioning them about is confusion of goals. You're doing the things that you ought to be doing, and remember why you are doing them. You will be rewarded, but not necessarily in an immediate, public way.