Technically, there is no such thing as a bitcoin. There is only a ledger (the blockchain) that contains transactions. A transaction refers to outputs from previous transactions, and specifies new spendable outputs.
A transaction output consists of a Bitcoin address, and an amount. And for practical purposes we pretend as if these amounts represent actual "bitcoins".
So if I send a transaction to your address for the amount of 3, we say "I sent you 3 bitcoins". But all it does is adding a transactions to the ledger that says 3 from my address to your address, signed with the private key that corresponds to my address.
Just like you say, it's just a number in the transaction.
Now regarding if bitcoins have IDs: no. Say I have 10 different addresses with 1 bitcoin each. I can now spend all these 10 together, in one single transasction, to one new address. This will create one new spendable output of 10 bitcoins. At this point it's impossible to distinguish the previous 10 separate coins. The new spendable output for 10 bitcoins is "atomic", I can only spend that 10 in its entirety. If I want to spend only 0.5 of that 10, I would send 0.5 to the recipient and 9.5 back to an address of my own.
Similarly, I can also have 1 bitcoin and divide that into 20 parts of 0.05 BTC each, all on different addresses, in one single transaction. I can then mix up one or more of these 0.05 BTC parts with other fractions of other bitcoins, merge them, et cetera.
So no unless a (fraction of a) bitcoin has moved completely separately from any other bitcoins, you can typically not track bitcoins to their origin, or associate them with some ID.
P.S. this model of a transaction is actually a gross simplification, more complex constructs are possible, but for sake of simplicity and clarity this basic interpretation should do.