How do we know that God didn't lie at Sinai? Maybe he said he was good and compassionate, and promised us reward, but it's all a trick? Why believe that God is true?
In context we know that God is good from observing His deeds, i.e. that He created human beings as an act of pure benevolence, not because He needs anything from us as the shaar bitachon (gate 4 of Chovos Halevavos) says.
That one is conscious of G-d's abundant goodness to man, and how He brought him into existence out of abundant and pure benevolence and kindness, without man being worthy of this, nor because G-d has any need for him, but only out of generosity, benevolence, and goodness, as we explained in the gate of reflection of this book, and like King David said "Many, O L-ord my G-d, are Your wonderful works which You have done, and Your thoughts which are toward us: they cannot be reckoned up in order to You; if I would declare and speak of them, they are more than can be numbered" (Tehilim 40:5)
and likewise in the shaar avoda Elokim (Gate 3 ibid): "The first is the universal goodness of G-d which embraces all mankind, in having brought human creatures into existence when previously they were naught; in keeping them in life and bestowing on them bounties which we have cited in the second treatise of this work. They are accordingly under a universal obligation of service to the blessed Creator."
I truly believe that when one goes astray from the direct view of G-d (via Torah), (kol ha'adam kozev) Each of us are only human and have made a mistake. It appears as if G-d is hiding or lying. We become blind in the lies of our limitations.
Barukh HaShem, He took the initiative and compassion to offer us His free education (Torah) to help us channel out lies from the authentic.
Many learnt that the word lie "sheker", each letter stands on only one leg, unstable.
Many learnt that "Emeth" truth stands on 2 legs. Strong foundation.
A lie will eventually cause a breakdown of one's recognition of the many blessings of G-d.
When we are not sure concerning spiritual blindness or deceit, "Dirshuni vechiyu" HaShem says "seek sincerely for me that you may live. We should use our brain, and of course seek a learned person who is also full of ahavas Yisra'el for guidance to broaden our horizons of how to attain this wisdom.
G-d is good, yes. Evil is the absence of productivity. What may appear to be evil actions from God is the balance of positive and negative. Even destruction and recycling of nature (the universe) follows G-d's good laws.
It is not fair for one to judge G-d. We cannot comprehend beyond the 3rd or 4th dimension.
I love the expressions of "derekh HaShem," Huqim, ofan, orach" all variations to deep meaning of "way, path, law, etc., which are not limited to a human concept of a celestial king sitting on a throne, but goes even deeper in meaning than that, like the throne of all the laws of Physics, Ethics, Justice, etc.
Our brain interfaces with over 110 billion neuron receptors, very complex. Imagine them tuned into the Torah mega battery of Reality.
Truth or lie does not depend on our opinion, experience, or belief. Truth is independent. We either hook up to it, or aimlessly wonder. A little knowledge of Truth is better than none, but we must pursue further so as not to become stagnate.
How do we know that God didn't lie at Sinai when he said he was good and compassionate
I assume you're referring to Shemot 34:6-7
The Lord passed before him and proclaimed: “The Lord! the Lord! a God compassionate and gracious, slow to anger, abounding in kindness and faithfulness, extending kindness to the thousandth generation, forgiving iniquity, transgression, and sin
Since we're playing devil's advocate: There are multiple places in Chumash where God is not "compassionate," "slow to anger," or "forgiving," even after He said He would be:
Bamidbar ch 11
1 The people took to complaining bitterly before the Lord. The Lord heard and was incensed: a fire of the Lord broke out against them, ravaging the outskirts of the camp.
Bamidbar ch 14
11 And the Lord said to Moses, “How long will this people spurn Me, and how long will they have no faith in Me despite all the signs that I have performed in their midst? 12 I will strike them with pestilence and disown them, and I will make of you a nation far more numerous than they!”
35 I the Lord have spoken: Thus will I do to all that wicked band that has banded together against Me: in this very wilderness they shall die to the last man.’”
Bamidbar ch 23
3 Thus Israel attached itself to Baal-peor, and the Lord was incensed with Israel. 4 The Lord said to Moses, “Take all the ringleaders and have them publicly impaled before the Lord, so that the Lord’s wrath may turn away from Israel.” ... 9 Those who died of the plague numbered twenty-four thousand.
but it's all a trick
Well, God is known for playing tricks.
Bamidbar ch 11: God promises to deliver meat, which He does, but then He kills those who eat it.
Devarim ch 13
2 If there appears among you a prophet or a dream-diviner and he gives you a sign or a portent, 3 saying, “Let us follow and worship another god”—whom you have not experienced—even if the sign or portent that he named to you comes true, 4 do not heed the words of that prophet or that dream-diviner. For the Lord your God is testing you to see whether you really love the Lord your God with all your heart and soul.
Job ch 1: God plays a cruel trick on Job to test his faith.
If you want a source within the Torah that God didn't lie, see Deuteronomy 32:4.
אל אמונה ואין עול צדיק וישר הוא
You say "How do we know that G-d didn't lie at Sinai?". Let's make "How do we know that X didn't lie at Sinai?" and X="G-d". Now, just as an exercise, make X="I", X="my father", X="that tree", X="the thing" and see how that sentence looks like. That sentence makes some sense a priori when X="I" or X="my father", makes no sense when X="the tree" and is obscure when X="the thing". Why? Because of the meaning of the words "father", "tree" and "thing", more or less known to all. What is the meaning of the word "G-d"? Define "G-d". Let's say, for instance, that in the definition of "G-d" there is this clause: "G-d" is not a subject in sentences with the verb "lie". Then your question will make no sense. This is more of a linguistic problem than a philosophical one. When we say G-d, Hashem, etc, we usually refer to the elohim, YHWH, etc found in a Sefer Torah. All we know about G-d is what the Torah tells us. You can define as you want the word "G-d", but for jews the definition is as given in the Torah. The Torah given by G-d at Sinai. So if G-d lied about the Torah, then G-d lied about the definiton of G-d, ie the definition of G-d as known by the jews is not true, says the G-d. So, either you acknowledge the Torah as it is, then by reductio ad absurdum you conclude that G-d didn't lie at Sinai, or you don't acknowledge the Torah, in which case the definition of the word "G-d" is as obscure as the word "thing", until you come up by yourself with a clear definition, which may suit you very well, even may suit others, but never those who acknowledge the Torah.