If someone posts something on the internet using their phone's data connection, is it possible to track their location? For example, somehow link their IP address and figure out their location. Or even better, use the IP address, and find out which phone IMEI that post came from? Or something similar? i.e get their cell location based on the IP address maybe?
It depends on whether you are reading the post alone, whether you have access to the access logs which would give the source IP address, or whether you are a government agency with serious data collection resources.
If you are reading the post then no, you cannot get a location as there's typically no information on the source of the post other than the poster's username or handle.
If you have access to the server access logs then you probably can get the source IP address of the connection. With that information you can generally tell using a geolocation site or using whois lookups. That information may help you narrow it down to mobile provider or internet service provider, and that can often give you a general location. That general location can be pretty big though if the mobile provider or ISP has a wide coverage base. Also, if someone is using an anonymity service the IP address you see will not help you track them.
If you are a government with lots of resources and you want to know where a post came from you will likely have a database of all the connection information in your country and possibly others as well. That would include every mobile call, every mobile data connection, etc. Chances are this would be enough to track you, although anonymization may still work.
You can, but you will need the cooperation of their cellphone service provider.
When a user has their cellphone on and connected to the network (even when they aren't actively using it), the cellphone network provider knows their IMEI and the base station they are currently closest to. They need this information to be able to root calls and text messages to the device. The signal strength might also be used to estimate the current distance to the base station. The provider also assigns an IP address to each cellphone (identified by IMEI) which is online. So they know which customer was online when with what IP address.
By correlating location data and IP lease data, they can find the approximate location from which an IP connection took place and the name of the customer.
However, network providers are bound to privacy laws and will not reveal this information easily. The exact laws vary from jurisdiction to jurisdiction, but usually this information is only available for law enforcement personnel during a criminal investigation. In many places, a court order is required to access this data.
To answer the gist of your questions, the average user cannot simply track your physical location by your mobile IP address.
The way mobile IP addresses are assigned is a bit different than you may think. Basically, a mobile phone accesses the internet through a sort of VPN provided by the cellular provider. This paper explains why mobile IP address location (an pretty much any indirect geolocation) is not possible for smartphones (yet?).
However, there are two big caveats to this no. The first is that if you have legal justification, you can access a great amount of information that you may be able to piece together to geolocate a phone. This is because there are logs all along the way tying phones to towers and thus locations (however there are ways to spoof even that).
The second caveat is that unauthorised access is not unheard of. If a hacker was able to install malware on the target's phone -bam- the sky is the limit! Moreover, a hacker could theoretically breach any system within the process and access the logs (to inlcude your own computer -which may have a backup of your phone's logs).
It is worth noting that you can program a website to get the smartphones physical location. The most common method is the HTML5 geolocation method but note that this in non-discreet as noted
“User Agents must not send location information to Web sites without the express permission of the user.”
It is also worth noting that general IP address lookups only provide you (the general public) with a location of the registered ISP. Thus even if you did have the 'real' IP address, you would still only get a very general location (and sometimes not even that).