is one allowed to ask a child to do a malacha of shabbos? does your answer also apply to a non-Jew?
Generally one is prohibited from instructing anyone to do melachah ("work") on Shabbos (The Sabbath), but although many of the reasons to prohibit instructing a non-Jew from preforming melachah can conceptually be applied to instructing a child as well the two cases are distinct from each other in many ways.
A Jewish child is required to be trained in the performance of the mitzvos/commandments (chinuk). This obligation falls primarily on the child's father but there are many variables which are not relevant here. One is not allowed to instruct a child to transgress a Torah prohibition therefore one may not instruct a child to do a melachah on Shabbos. (O.C. 341:1, Chayei Adam [Tefillah uB'rachos]66:6, M.B. 341:4). The various heterim (leniencies) regarding children on Shabbos apply to Rabbinic prohibitions.
Regarding a situation of Pikuach Nefesh it is preferable to have an adult preform the melachah rather than a child (O.C. 328:12).
Instructing a non-Jew to do a melachah is generally forbidden and various reasons are given for this prohibition which obviously have nothing to do with teaching one's child to observe mitzvos. For an overview see Shemiras Shabbos K'Hilchasa 30 footnote 2.
With regard to small children:
"... it is forbidden to instruct or cause a child to violate a prohibition even is the child is below the age of chinuch" (the age where a parent is obilgated to instuct his child in mitzvot) (in this case likely around the age of 4).
"...it is permitted to place a forbidden item in front of a child, even though the child will make use of that item in a forbidden manner." (This applies as long as the child isn't doing it to only benefit the parent)
Therefore children of this young age are permitted to play with muktzah items though one cannot tell a child to do so or directly cause the child to do so.
from Children in Halachah by Rabbi Simcha Bunim Cohen
You can not ask anyone to do Melacha (work) for you on Shabbos. Heterim (leniencies) are allowed (and even required) in certain situations, e.g. tsorchey tsibbur (communal needs) and sakanat nefashot (fatal danger). CYLOR as to when these situations apply and under what circumstances.
In those cases where it is permitted to ask a child, I believe it is preferable for somebody other than the child's parents to do so, since they are not obligated in chinuch at the same level.
There are no heterim to ask a Jewish child to do a milacha di'oraisa on Shabbos unless someone's life is in danger and there is no one but the child available to do it. (Thank you Yirmiyahu for being clearer than I was before this edit!)