I suppose you could try to learn a mapping from characters (or character-level n-grams) to part-of-speech. This would be analogous to document classification. Instead of a document, you have a single word. And instead of a sequence of words, you have a sequence of letters.
With this formulation, most of the tricks which extract features from text could also be applied to extract features from characters (although your mileage may vary). At the simple end of the scale, you could try "old-school" techniques like bag-of-words and TF-IDF (except you would have a bag-of-characters, and it would be Character-Frequency Inverse-Word-Frequency). On the complex end of the scale, you could try to learn embeddings of characters or character n-grams.
However, before you get started, there are a few things I think you should keep in mind:
Do you think there is enough information in sub-word features to classify parts of speech? I think it's pretty unlikely (at least for English). Your model might learn some of the easy cases (e.g. an "-ly" suffix often indicates that the word is an adverb), but I don't think it would perform well in general.
This is actually a multilabel classification problem, because there are many words which can serve as more than one part-of-speech. Also, names (proper nouns) are a subclass of nouns.
What happens if you feed your model a non-existent word? Should your model try to classify it as a part-of-speech, or do you want it to recognize non-existent words?
If you're new to machine learning, consider putting this aside for a little while. Jumping headfirst into a difficult classification problem with deep learning is a hard, confusing way to learn.
Finally, are you doing this for experimental/fun reasons, or is this intended to be part of a production application? If it's the former, then go for it! Worst case: it doesn't work but you learn something.
But if this project is for anything more serious, then you should not train a ML model to solve this problem. Your model will never outperform a dictionary :)