Calculating inventory - a number of questions

When calculating the value of inventory...

 

Is it based on what I actually paid, or what the item is worth?

 

For example, let's say I get a smoking deal on a widget for resale.  For simplicity, let's say I started the year with zero inventory, so this is my only inventory item, and I have not sold it yet.  In January, I pay $5 for said widget.  Typical wholesale cost was $15, and resale value was $30.  In December of that same year, the wholesale cost has risen to $40, and resale value has risen to $90.  What would my beginning and end inventory values be?

 

Working from  the above example, if I were to buy another widget later in the year December and pay $40 for it (and still having both of them) what would my beginning and end values be?

 

If I pay tax when purchasing an item, do I include that in any of the values for beginning/end of year, costs of goods (such as Cost of Purchases, Purchases Withdrawn for Personal Use, etc.) etc.?