If I have money and I give it away and then go on Medicaid, am I defrauding the government?

You are not defrauding the government as long as all assets and transactions are fully and accurately disclosed with the Medicaid application. Gifting is permitted in certain circumstances. This is something that should be reviewed by a qualified elder law attorney.