this is not a GameObject; its class is derived from MonoBehaviour. You use the correct semantics later on:
.gameObject
Using the shorthand for this.gameObject works fine:
inventory.AddItem(gameObject);
However, you should use something other than an ArrayList; a List is probably what you want. Using .gameObject on item is useless; I don’t even know why that compiles.
import System.Collections.Generic;
var items : List.<GameObject>;
function AddItem(item:GameObject) {
items.Add(item);
}