Economics commonly defined, in economics textbooks or academic literature more widely, using the famous definition of economics provided by Robbins (1935, p. 16), which sets demarcation for economics to be:
the science which studies human behaviour as a relationship between ends and scarce means which have alternative uses
This is admittedly very broad, but its not dissimilar to other sciences, consider definition of physics by Maxwell in his Matter and Motion on pp 8:
Physical science is that department of knowledge which relates to the order of nature, or, in other words, to the regular succession of events.
if you squint your eyes, you can imagine everything under the above definition as well, technically you could probably squeeze even whole economics in it as human behaviour as a relationship between ends and scarce means which have alternative uses arguably consists of regular succession of events (funilly enough there is actually a serious academic field - albeit mostly heterodox (i.e. fringe) - called econophysics).
Jokes aside, point is many fields are defined quite broadly, there is nothing wrong with that. The problem of demarcation of each field always evolves and there are always topics where one cannot easily distinguish whether we are still dealing with physics or chemistry, or whether we deal with chemistry or biology, or whether we deal with biology and economics or whether we deal with economics or psychology. What even more you will have various multidisciplinary topics where it is very difficult to say where they belong and one has to exercise personal judgement.
My personal way of distinguishing what is still economics and not for the purposes of this site is whether something is recognized as proper subfield of economics by American Economic Association which is one of the largest professional bodies for economics in the world.
According to JEL classification (developed by AEA), the question to which you linked would clearly be an economic question.
To be more specific that question would fall under:
- K: Law and Economics, K1: Basic Areas of Law, K14: Criminal Law
which according AEA to guidelines covers:
Guideline: Covers studies about issues related to the intersection of criminal law and economics or economies.
Keywords: Crime, Criminal Justice, Criminal Law, Economics of Crime, Prisons
This is actually not even the only category it could potentially fit P480 that deals with legal institutions more broadly. Furthermore, the question depending on methods used to analyze it (e.g. micro/behavioral models) would neatly fill into further categories still.
Generally, if some topic can be published in legitimate economics journals, and if that topic does not violate any other rules (e.g. not too broad or no questions about personal finance etc see our help center) then the question would be on topic.
Personally, although my opinion might be biased being academic economist, I did not even thought of that question as not being primarily about economics. Our society has limited resources when it comes to law enforcement, we want to minimize the amount of crime happening in the society, its natural economic question to ask what sort of incentive structures imposed by penal codes will do this in the most efficient manner.
Regarding the questions you specifically asked about:
Can I ask questions about the best fertilizer for farmers to put on their crops?
Depends how you exactly frame the question, but in principle yes. There is a field of agricultural economics. In fact this is one of the oldest fields of economics. We even have tag for agriculture you can look at highly voted questions within that tag.
This being said the question above would be closed for being to broad, and needing details or clarity. If you can narrow it down and make it more specific, e.g. how do corn yields vary with the use of different type of industrial fertilizer? and you specify the types you are interested interested in then yes it could be on topic.
Again I would recommend having loot at the JEL codes as they make demarcation what would still be considered standard economics and what not. Agricultural economics has codes starting with Q.
What about the best treatment for cancer?
This again could be asked in principle (we again have specific tag health-economics. But again the question as you posed is too vague and needs details and clarity and would be closed for that reason. For example what do you even mean by best? Most cost-efficient?
However, questions like: "is chemotherapy in the US more cost efficient way of treating cancer relative to operations"? would be on topic. However, if you want to ask about how chemotherapy affects human body, or what the procedure even entails, what are the side effects etc, that would not belong to economics.se.
Again I would invite you to have look at JEL codes starting with I1 which cover economics of healthcare for some rough idea of demarcation.
Can I ask about how to get my teenager to clean up their room?
Once again, as the question is written, it would be to vague, but economics of family is valid economics field. Once again we even have a tag for it although its set as a tag synonym to demographics and there are only very few questions about it. In addition, as mentioned in our help center you should not ask personal finance/economics questions.
However, in general economics of family and household is one of the classic economic fields. In fact, the earliest tracts on economics were about management of household and economics literally comes from ancient Greek: οἰκονομία (oikonomía), which literally means “management of a household", so this is, if you pardon my street vernacular, 'OG' economics.
A question like:
"from optimal design perspective, what set of rules will incentivize child to clean their room in line with parental preferences?"
would be question that would be clearly on topic. Again I recommend to have look at JEL codes for demarcation, especially codes starting with D1.
Note just because question is about some topic that most laymen more closely relate to some field does not mean its a question about that field. For example, consider cancer. If you ask, what is the atomic structure of cancer that might be appropriate topic for physics. If you ask how the cancer cells behave that is likely most appropriate topic for biologist. If you ask how can we kill cancer cells while preserving human life that is proper question for medical doctor. If you ask, which cancer treatment is 'best' meaning one that maximizes social welfare given that people derive positive utility from living but negative utility from paying for treatment whether in terms of money, labor, other resources, taxes etc that is crystal clear economics question that someone not trained in economics would not be qualified to answer (in the same manner as an economist would not be trained or qualified to answer the preceding examples).
Or when it comes to that fertilizer question, again if the question would be what is the atomic mass of atoms in that fertilizer that would be clear physics question. If you ask what is the chemical composition of the fertilizer thats chemistry. If you ask what is the effect of fertilizer on human health that would be medicine. If you ask which fertilizer maximizes or profit or utility or some other objective its clearly economics.