When you buy mine craft PC you have online to play?

It's just that I bought minecraft PC and when I play online it just says can't connect to server. When I just bought minecraft pc and I put a server and it said can't connect to server I have internet on.

Please guys help me why its doing this please.

Some help me I want to play with peoples

You have to have Internet access to authenticate that your account is valid.

Once you've logged in and into the game, you can play single player without needing Internet access again, or you can go online to play multiplayer.