What does the scriptSing contain when it is decoded with RPC framework? I'm trying to get the wallet id from scriptSing and ScriptPubKey. When I decode the scriptSig, the result does not contain the address address. But when I decode the scriptPubKey, it contains the address.

Why the scriptSig does not contain the address?

If it does not contain the wallet id, does it contain any references to previous transaction output?
if yes, what is the property inside the RPC response that contains the reference to previous output? 

This is the documentation reference bitcoin core
Bitcoin does not actually use addresses internally. Addresses are just a way for us humans to specify what scriptPubKey we want the wallet software to create. When a transaction output is spent, the address is not included anywhere because it is not needed.

Bitcoin Core's decoding RPCs will include more information than is actually present in the transaction, block, or script. This is because it can infer and display the information present in different ways.

Since an address describes a scriptPubKey, it is typically possible to take a scriptPubKey and compute an address that corresponds to it. This is not always possible because not all scriptPubKeys correspond to addresses. But usually they do, and so the decoder will show you that.

However scriptSigs do not have corresponding addresses. You cannot get a scriptSig from an address and vice versa. In fact, the idea that you send from an address is really not true; that's just a simpler way to describe things to people. It isn't how Bitcoin actually works.

The reference to the previous output is done by explicitly referencing it, not referencing some address. Every output is uniquely identified by the transaction it is included in, and its index in the array of outputs in that transaction. Bitcoin Core displays this to you as the txid and vout fields for each input.

Bitcoin really does not have wallet ids. Contrary to popular belief, addresses are not wallet ids, nor are public keys.